23 lines
1.1 KiB
Django/Jinja
23 lines
1.1 KiB
Django/Jinja
{%- set default_system = "You are a general knowledge expert. Concisely reason step-by-step through the question and options to find the correct answer. Give your answer in a \boxed{} format ensuring the box only contains a single capital letter. Example output: \boxed{C}" %}
|
|
{%- if messages and messages[0].role == 'system' %}
|
|
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
|
{%- else %}
|
|
{{- '<|im_start|>system\n' + default_system + '<|im_end|>\n' }}
|
|
{%- endif %}
|
|
|
|
{%- for message in messages %}
|
|
{%- if not (loop.first and message.role == 'system') %}
|
|
{{- '<|im_start|>' + message.role + '\n' }}
|
|
|
|
{# Extract and format reasoning content if it is passed structurally #}
|
|
{%- if message.role == 'assistant' and message.reasoning_content is defined and message.reasoning_content %}
|
|
{{- '<think>\n' + message.reasoning_content.strip('\n') + '\n</think>\n\n' }}
|
|
{%- endif %}
|
|
|
|
{{- message.content + '<|im_end|>\n' }}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
|
|
{%- if add_generation_prompt %}
|
|
{{- '<|im_start|>assistant\n' }}
|
|
{%- endif %} |