Felladrin commited on
Commit
06b255f
1 Parent(s): f52f355

Add `chat_template` to `tokenizer_config.json`

Browse files

Reference: https://huggingface.co/docs/transformers/main/en/chat_templating#what-template-should-i-use

Files changed (1) hide show
  1. tokenizer_config.json +1 -0
tokenizer_config.json CHANGED
@@ -26,6 +26,7 @@
26
  }
27
  },
28
  "bos_token": "<s>",
 
29
  "clean_up_tokenization_spaces": false,
30
  "eos_token": "</s>",
31
  "legacy": false,
 
26
  }
27
  },
28
  "bos_token": "<s>",
29
+ "chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
30
  "clean_up_tokenization_spaces": false,
31
  "eos_token": "</s>",
32
  "legacy": false,