| {% set system_prompt = "<|begin_of_text|><|start_header_id|>system<|end_header_id|> | |
| You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language." %} | |
| {% set roles = ["<|start_header_id|>user<|end_header_id|> | |
| ", "<|start_header_id|>assistant<|end_header_id|> | |
| "] %} | |
| {% set sep = "<|eot_id|>" %} | |
| {% set sep2 = "<|end_of_text|>" %} | |
| {{ system_prompt }} | |
| {% for message in messages %} | |
| {% if message['role'] == 'user' %} | |
| {{ roles[0] }}{{ message['content'] }}{{ sep }} | |
| {% else %} | |
| {{ roles[1] }}{{ message['content'] }}{{ sep }} | |
| {% endif %} | |
| {% endfor %} | |
| {{ sep2 }} |