Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
machineuser
commited on
Commit
·
e094eba
1
Parent(s):
7026e84
Sync widgets demo
Browse files
packages/tasks/src/model-data.ts
CHANGED
|
@@ -54,7 +54,7 @@ export interface ModelData {
|
|
| 54 |
base_model_name?: string;
|
| 55 |
task_type?: string;
|
| 56 |
};
|
| 57 |
-
|
| 58 |
};
|
| 59 |
/**
|
| 60 |
* all the model tags
|
|
|
|
| 54 |
base_model_name?: string;
|
| 55 |
task_type?: string;
|
| 56 |
};
|
| 57 |
+
tokenizer_config?: TokenizerConfig;
|
| 58 |
};
|
| 59 |
/**
|
| 60 |
* all the model tags
|
packages/widgets/src/lib/components/InferenceWidget/widgets/ConversationalWidget/ConversationalWidget.svelte
CHANGED
|
@@ -49,11 +49,11 @@
|
|
| 49 |
return;
|
| 50 |
}
|
| 51 |
|
| 52 |
-
if (config.
|
| 53 |
error = "Tokenizer config not found";
|
| 54 |
return;
|
| 55 |
}
|
| 56 |
-
tokenizerConfig = config.
|
| 57 |
|
| 58 |
const chatTemplate = tokenizerConfig.chat_template;
|
| 59 |
if (chatTemplate === undefined) {
|
|
|
|
| 49 |
return;
|
| 50 |
}
|
| 51 |
|
| 52 |
+
if (config.tokenizer_config === undefined) {
|
| 53 |
error = "Tokenizer config not found";
|
| 54 |
return;
|
| 55 |
}
|
| 56 |
+
tokenizerConfig = config.tokenizer_config;
|
| 57 |
|
| 58 |
const chatTemplate = tokenizerConfig.chat_template;
|
| 59 |
if (chatTemplate === undefined) {
|
packages/widgets/src/routes/+page.svelte
CHANGED
|
@@ -36,7 +36,7 @@
|
|
| 36 |
tags: ["conversational"],
|
| 37 |
inference: InferenceDisplayability.Yes,
|
| 38 |
config: {
|
| 39 |
-
|
| 40 |
bos_token: "<s>",
|
| 41 |
chat_template:
|
| 42 |
"{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
|
|
|
| 36 |
tags: ["conversational"],
|
| 37 |
inference: InferenceDisplayability.Yes,
|
| 38 |
config: {
|
| 39 |
+
tokenizer_config: {
|
| 40 |
bos_token: "<s>",
|
| 41 |
chat_template:
|
| 42 |
"{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|