Files
GRMR-V3-L1B/chat_template.jinja

31 lines
843 B
Plaintext
Raw Permalink Normal View History

{{- bos_token }}
{%- if not date_string is defined %}
{%- if strftime_now is defined %}
{%- set date_string = strftime_now("%d %b %Y") %}
{%- else %}
{%- set date_string = "26 Jul 2024" %}
{%- endif %}
{%- endif %}
{#- Remove system message handling entirely #}
{%- if messages[0]['role'] == 'system' %}
{%- set messages = messages[1:] %}
{%- endif %}
{#- Process messages with role mapping #}
{%- for message in messages %}
{%- if message['role'] == 'user' %}
{{- '<|start_header_id|>text<|end_header_id|>
'+ message['content'] | trim + '<|eot_id|>' }}
{%- elif message['role'] == 'assistant' %}
{{- '<|start_header_id|>corrected<|end_header_id|>
'+ message['content'] | trim + '<|eot_id|>' }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|start_header_id|>corrected<|end_header_id|>
' }}
{%- endif %}