31 lines
843 B
Plaintext
31 lines
843 B
Plaintext
|
|
{{- 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 %}
|