| {{ '<|end_of_text|>' }}{%- for m in messages -%}{%- if m['role'] == 'assistant' -%}<|im_start|>{{ m['role'] }} | |
| {% generation %}{{ m['content'] }}<|im_end|> | |
| {% endgeneration %}{%- else -%}<|im_start|>{{ m['role'] }} | |
| {{ m['content'] }}<|im_end|> | |
| {% endif %}{% endfor %}{%- if add_generation_prompt -%}<|im_start|>assistant | |
| {% endif %} |