Download chat_template.jinja from SamChen567/compressor_ablation_transformer_decoder_flat: direct link, hf CLI and curl.
- Browser
- Download file 2.04 kB
-
https://huggingface.co/SamChen567/compressor_ablation_transformer_decoder_flat/resolve/main/chat_template.jinja
- Command line
-
hf download hf://SamChen567/compressor_ablation_transformer_decoder_flat/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/SamChen567/compressor_ablation_transformer_decoder_flat/resolve/main/chat_template.jinja
2.04 kB
| {%- set identifier = 'im' %} | |
| {% for message in messages %} | |
| {% if add_system_prompt and loop.first and message['role'] != 'system' %} | |
| {{- '<|im_start|>system | |
| You are VideoLLaMA3 created by Alibaba DAMO Academy, a helpful assistant to help people understand images and videos.<|im_end|> | |
| ' -}} | |
| {% endif %} | |
| {% if message['role'] == 'stream' %} | |
| {% set identifier = 'stream' %} | |
| {% else %} | |
| {% set identifier = 'im' %} | |
| {% endif %} | |
| {{- '<|' + identifier + '_start|>' + message['role'] + ' | |
| ' -}} | |
| {% if message['content'] is string %} | |
| {{- message['content'] + '<|' + identifier + '_end|> | |
| ' -}} | |
| {% else %} | |
| {% for content in message['content'] %} | |
| {% if content is string %} | |
| {{- content -}} | |
| {% elif content['type'] == 'text' or 'text' in content %} | |
| {{- content['text'] -}} | |
| {% elif content['type'] == 'image' or 'image' in content %} | |
| {% if 'timestamp' in content %} | |
| {{- 'Time ' + content['timestamp'] | round(1) | string + 's: ' -}} | |
| {% endif %} | |
| {{- '<image> | |
| ' -}} | |
| {% elif content['type'] == 'video' or 'video' in content %} | |
| {% for i in range(content['num_frames']) %} | |
| {% if 'timestamps' in content %} | |
| {{- 'Time ' + content['timestamps'][i] | round(1) | string + 's:' -}} | |
| {% endif %} | |
| {% if i < content['num_frames'] - 1 %} | |
| {{- '<image>,' -}} | |
| {% else %} | |
| {{- '<image> | |
| ' -}} | |
| {% endif %} | |
| {% endfor %} | |
| {% endif %} | |
| {% endfor %} | |
| {% if identifier == 'stream' %} | |
| {{- '<|' + identifier + '_end|>' -}} | |
| {% else %} | |
| {{- '<|' + identifier + '_end|> | |
| ' -}} | |
| {% endif %} | |
| {% endif %} | |
| {% endfor %} | |
| {% if add_generation_prompt %} | |
| {{- '<|im_start|>assistant | |
| ' -}} | |
| {% endif %} | |