xianbin commited on
Commit
7f77fd9
1 Parent(s): 1bfc2a0

Add chat template to tokenizer_config.json

Browse files
Files changed (1) hide show
  1. tokenizer_config.json +2 -1
tokenizer_config.json CHANGED
@@ -33,5 +33,6 @@
33
  "pad_token": null,
34
  "sp_model_kwargs": {},
35
  "tokenizer_class": "SEABPETokenizer",
36
- "unk_token": "<unk>"
 
37
  }
 
33
  "pad_token": null,
34
  "sp_model_kwargs": {},
35
  "tokenizer_class": "SEABPETokenizer",
36
+ "unk_token": "<unk>",
37
+ "chat_template": "{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}### USER:\n{{ message['content'] + '\n\n' }}{% elif message['role'] == 'assistant' %}### RESPONSE:\n{{ message['content'] + '\n\n' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}{% if add_generation_prompt %}### RESPONSE:\n{% endif %}"
38
  }