ehartford jlzhou commited on
Commit
95999a6
1 Parent(s): 26a9bd3

Add `chat_template` in tokenizer config (#11)

Browse files

- Add `chat_template` in tokenizer config (91b6fa1f5405def06916c6dd8f736a16a882cd2c)


Co-authored-by: Junlin Zhou <[email protected]>

Files changed (1) hide show
  1. tokenizer_config.json +1 -0
tokenizer_config.json CHANGED
@@ -37,6 +37,7 @@
37
  },
38
  "additional_special_tokens": [],
39
  "bos_token": "<s>",
 
40
  "clean_up_tokenization_spaces": false,
41
  "eos_token": "<|im_end|>",
42
  "legacy": true,
 
37
  },
38
  "additional_special_tokens": [],
39
  "bos_token": "<s>",
40
+ "chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|im_start|>user\n' + message['content'] + '<|im_end|>' }}\n{% elif message['role'] == 'system' %}\n{{ '<|im_start|>system\n' + message['content'] + '<|im_end|>' }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|im_start|>assistant\n' + message['content'] + '<|im_end|>' }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|im_start|>assistant' }}\n{% endif %}\n{% endfor %}",
41
  "clean_up_tokenization_spaces": false,
42
  "eos_token": "<|im_end|>",
43
  "legacy": true,