Add default chat template to tokenizer_config.json
Browse files[Automated] This PR adds the default chat template to the tokenizer config, allowing the model to be used with the new conversational widget (see [PR](https://github.com/huggingface/huggingface.js/pull/457)).
If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information.
- tokenizer_config.json +3 -2
tokenizer_config.json
CHANGED
@@ -45,5 +45,6 @@
|
|
45 |
"sp_model_kwargs": {},
|
46 |
"tokenizer_class": "GPTSw3Tokenizer",
|
47 |
"truncation_side": "left",
|
48 |
-
"unk_token": "<unk>"
|
49 |
-
}
|
|
|
|
45 |
"sp_model_kwargs": {},
|
46 |
"tokenizer_class": "GPTSw3Tokenizer",
|
47 |
"truncation_side": "left",
|
48 |
+
"unk_token": "<unk>",
|
49 |
+
"chat_template": "{{ eos_token }}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ 'User: ' + message['content']}}{% else %}{{ 'Bot: ' + message['content']}}{% endif %}{{ message['text'] }}{{ bos_token }}{% endfor %}Bot:"
|
50 |
+
}
|