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
@@ -1053,5 +1053,6 @@
|
|
1053 |
"model_max_length": 512,
|
1054 |
"pad_token": "<pad>",
|
1055 |
"tokenizer_class": "T5Tokenizer",
|
1056 |
-
"unk_token": "<unk>"
|
1057 |
-
}
|
|
|
|
1053 |
"model_max_length": 512,
|
1054 |
"pad_token": "<pad>",
|
1055 |
"tokenizer_class": "T5Tokenizer",
|
1056 |
+
"unk_token": "<unk>",
|
1057 |
+
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"
|
1058 |
+
}
|