Switch to unified view

a b/chat_templates/zephyr.jinja
1
{% if messages[0]['role'] == 'system' %}
2
    {% set offset = 1 %}
3
{% else %}
4
    {% set offset = 0 %}
5
{% endif %}
6
7
{% for message in messages %}
8
    {% if (message['role'] == 'user') != (loop.index0 % 2 == offset) %}
9
        {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
10
    {% endif %}
11
12
    {{ '<|' + message['role'] + '|>\n' + message['content'] | trim + eos_token + '\n' }}
13
{% endfor %}
14
15
{% if add_generation_prompt %}
16
    {{ '<|assistant|>\n' }}
17
{% endif %}