Image-Text-to-Text
Transformers
ONNX
Safetensors
English
idefics3
conversational
RaushanTurganbay HF Staff arjhinety commited on
Commit
bb436dc
·
1 Parent(s): 81cd9a7

Chat template: render string `content` instead of dropping it (#37)

Browse files

- Chat template: render string `content` instead of dropping it (c8e6bede241cb8317bede8c76dbe1e8873822a24)


Co-authored-by: Arjhine Ty <arjhinety@users.noreply.huggingface.co>

Files changed (2) hide show
  1. chat_template.json +1 -1
  2. tokenizer_config.json +1 -1
chat_template.json CHANGED
@@ -1,3 +1,3 @@
1
  {
2
- "chat_template": "<|im_start|>{% 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
  }
 
1
  {
2
+ "chat_template": "<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'] is string %}{{': ' + message['content']}}{% else %}{% 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 %}{% endif %}<end_of_utterance>\n{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}"
3
  }
tokenizer_config.json CHANGED
@@ -176,7 +176,7 @@
176
  "processor_class": "Idefics3Processor",
177
  "tokenizer_class": "GPT2Tokenizer",
178
  "truncation_side": "left",
179
- "chat_template": "<|im_start|>{% 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 %}",
180
  "unk_token": "<|endoftext|>",
181
  "vocab_size": 49152
182
  }
 
176
  "processor_class": "Idefics3Processor",
177
  "tokenizer_class": "GPT2Tokenizer",
178
  "truncation_side": "left",
179
+ "chat_template": "<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'] is string %}{{': ' + message['content']}}{% else %}{% 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 %}{% endif %}<end_of_utterance>\n{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}",
180
  "unk_token": "<|endoftext|>",
181
  "vocab_size": 49152
182
  }