Skip to content

Commit e97f49c

Browse files
authored
Rename tokenizer -> tokenizer_config in tasks and widgets (#494)
cc @coyotte508 @Wauplin
1 parent 72a1b5a commit e97f49c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/tasks/src/model-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface ModelData {
5454
base_model_name?: string;
5555
task_type?: string;
5656
};
57-
tokenizer?: TokenizerConfig;
57+
tokenizer_config?: TokenizerConfig;
5858
};
5959
/**
6060
* all the model tags

packages/widgets/src/lib/components/InferenceWidget/widgets/ConversationalWidget/ConversationalWidget.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
return;
5050
}
5151
52-
if (config.tokenizer === undefined) {
52+
if (config.tokenizer_config === undefined) {
5353
error = "Tokenizer config not found";
5454
return;
5555
}
56-
tokenizerConfig = config.tokenizer;
56+
tokenizerConfig = config.tokenizer_config;
5757
5858
const chatTemplate = tokenizerConfig.chat_template;
5959
if (chatTemplate === undefined) {

packages/widgets/src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
tags: ["conversational"],
3737
inference: InferenceDisplayability.Yes,
3838
config: {
39-
tokenizer: {
39+
tokenizer_config: {
4040
bos_token: "<s>",
4141
chat_template:
4242
"{% 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 %}",

0 commit comments

Comments
 (0)