Files
math_model/chat_template.jinja
ModelHub XC 4eb3ab8e92 初始化项目,由ModelHub XC社区提供模型
Model: cs-552-2026-middle-west/math_model
Source: Original Platform
2026-05-24 05:13:19 +08:00

19 lines
1.2 KiB
Django/Jinja

{%- set enable_thinking = false %}
{%- set boxed_instruction = "You are a mathematical reasoning model. Think step by step before giving your final answer. Break the problem into clear intermediate steps, showing all key calculations and logical deductions. Verify your answer by checking it satisfies the original conditions. Return the final answer in exact form whenever possible. Put only the final answer inside a LaTeX \\boxed{} expression — no explanations, units, or multiple answers inside the box unless the problem explicitly requires them." %}
{%- if messages|length > 0 and messages[0]['role'] == 'system' %}
{%- set system_message = boxed_instruction + "\n\n" + messages[0]['content'] %}
{%- set loop_messages = messages[1:] %}
{%- else %}
{%- set system_message = boxed_instruction %}
{%- set loop_messages = messages %}
{%- endif %}
{{- '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}
{%- for message in loop_messages %}
{{- '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>\n' }}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if not enable_thinking %}
{{- '<think>\n\n</think>\n\n' }}
{%- endif %}
{%- endif %}