Kill app on tokenizer load fail (#1044)
Browse files- src/lib/server/models.ts +2 -1
src/lib/server/models.ts
CHANGED
@@ -91,12 +91,13 @@ async function getChatPromptRender(
|
|
91 |
try {
|
92 |
tokenizer = await getTokenizer(m.tokenizer);
|
93 |
} catch (e) {
|
94 |
-
|
95 |
"Failed to load tokenizer for model " +
|
96 |
m.name +
|
97 |
" consider setting chatPromptTemplate manually or making sure the model is available on the hub. Error: " +
|
98 |
(e as Error).message
|
99 |
);
|
|
|
100 |
}
|
101 |
|
102 |
const renderTemplate = ({ messages, preprompt }: ChatTemplateInput) => {
|
|
|
91 |
try {
|
92 |
tokenizer = await getTokenizer(m.tokenizer);
|
93 |
} catch (e) {
|
94 |
+
console.error(
|
95 |
"Failed to load tokenizer for model " +
|
96 |
m.name +
|
97 |
" consider setting chatPromptTemplate manually or making sure the model is available on the hub. Error: " +
|
98 |
(e as Error).message
|
99 |
);
|
100 |
+
process.exit();
|
101 |
}
|
102 |
|
103 |
const renderTemplate = ({ messages, preprompt }: ChatTemplateInput) => {
|