llava-next / model /chat_template.jinja
cjell's picture
clean
83ac608
raw
history blame contribute delete
500 Bytes
{% for message in messages %}{{ '<|start_header_id|>' + message['role'] + '<|end_header_id|>
'}}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ '
' + content['text'] + '<|eot_id|>' }}{% endfor %}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>
' }}{% endif %}