vip-llava-13b-hf / chat_template.json
RaushanTurganbay's picture
Fix system message
3360655 verified
raw
history blame contribute delete
551 Bytes
{
"chat_template": "{% for message in messages %}{% if message['role'] == 'user' %}{{ '###Human: '}}{% elif message['role'] == 'assistant' %}{{ '###' + message['role'].title() + ': '}}{% endif %}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>\n' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] }}{% endfor %}{% endfor %}{% if add_generation_prompt %}{{ '###Assistant:' }}{% endif %}"
}