mrsalehi commited on
Commit
9cf34ca
1 Parent(s): e5ffc6c

updated chat_template

Browse files
Files changed (1) hide show
  1. tokenizer_config.json +1 -1
tokenizer_config.json CHANGED
@@ -229,7 +229,7 @@
229
  "AutoProcessor": "preprocessing_molmo.MolmoProcessor"
230
  },
231
  "bos_token": "<|endoftext|>",
232
- "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 %}",
233
  "clean_up_tokenization_spaces": false,
234
  "eos_token": "<|endoftext|>",
235
  "model_max_length": 8192,
 
229
  "AutoProcessor": "preprocessing_molmo.MolmoProcessor"
230
  },
231
  "bos_token": "<|endoftext|>",
232
+ "chat_template": "{% for message in messages -%}\n {%- if (loop.index % 2 == 1 and message['role'] != 'user') or \n (loop.index % 2 == 0 and message['role'].lower() != 'assistant') -%}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif -%}\n {{ message['role'].capitalize() + ': ' + message['content'] }}\n {%- if not loop.last -%}\n {{ ' ' }}\n {%- endif %}\n {%- endfor -%}\n {%- if add_generation_prompt -%}\n {{ ' Assistant:' }}\n {%- endif %}",
233
  "clean_up_tokenization_spaces": false,
234
  "eos_token": "<|endoftext|>",
235
  "model_max_length": 8192,