Update chat_template.json to incorporate `generation` tag

#9
by zjysteven - opened
Files changed (1) hide show
  1. processor_config.json +1 -1
processor_config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "chat_template": "{% for message in messages %}{{message['role'].capitalize()}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>\n{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}",
3
  "image_seq_len": 64,
4
  "processor_class": "Idefics2Processor"
5
  }
 
1
  {
2
+ "chat_template": "{% for message in messages %}{{message['role'].capitalize()}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% if message['role'] != 'assistant' %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>\n{% else %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{% generation %}{{line['text']}}<end_of_utterance>\n{% endgeneration %}{% endif %}{% endfor %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}",
3
  "image_seq_len": 64,
4
  "processor_class": "Idefics2Processor"
5
  }