Files
OLMo-2-1124-7B-Instruct_SFT…/chat_template.jinja
ModelHub XC efffbf67ae 初始化项目,由ModelHub XC社区提供模型
Model: Neelectric/OLMo-2-1124-7B-Instruct_SFT_mathv00.01
Source: Original Platform
2026-05-25 11:13:19 +08:00

30 lines
1.1 KiB
Django/Jinja

{{ bos_token }}
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{%- set system_message = "You are a helpful AI Assistant that provides well-reasoned and detailed responses. You first think about the reasoning process as an internal monologue and then provide the user with the answer. Respond in the following format: <think>
...
</think>
<answer>
...
</answer>" %}
{%- endif %}
{{- '<|system|>\n' + system_message + '\n' }}
{%- for message in messages %}
{%- if message['role'] == 'user' %}
{{- '<|user|>\n' + message['content'] + '\n' }}
{%- elif message['role'] == 'assistant' %}
{{- '<|assistant|>\n' }}
{% generation %}
{%- if not loop.last %}
{{- message['content'] + eos_token + '\n' }}
{%- else %}
{{- message['content'] + eos_token }}
{%- endif %}
{% endgeneration %}
{%- endif %}
{%- if loop.last and add_generation_prompt %}
{{- '<|assistant|>\n' }}
{%- endif %}
{%- endfor %}