Add chat template
Browse filesSee https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt?tabs=python&pivots=programming-language-chat-ml for more information.
- tokenizer_config.json +2 -1
tokenizer_config.json
CHANGED
@@ -5,5 +5,6 @@
|
|
5 |
"eos_token": "<|endoftext|>",
|
6 |
"model_max_length": 8192,
|
7 |
"tokenizer_class": "GPT4Tokenizer",
|
8 |
-
"unk_token": "<|endoftext|>"
|
|
|
9 |
}
|
|
|
5 |
"eos_token": "<|endoftext|>",
|
6 |
"model_max_length": 8192,
|
7 |
"tokenizer_class": "GPT4Tokenizer",
|
8 |
+
"unk_token": "<|endoftext|>",
|
9 |
+
"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 %}"
|
10 |
}
|