初始化项目,由ModelHub XC社区提供模型
Model: Neelectric/OLMo-2-0425-1B-Instruct_SFT_mathv00.01 Source: Original Platform
This commit is contained in:
30
chat_template.jinja
Normal file
30
chat_template.jinja
Normal file
@@ -0,0 +1,30 @@
|
||||
{{ 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 %}
|
||||
Reference in New Issue
Block a user