sohaddad commited on
Commit
7b6d984
·
verified ·
1 Parent(s): ba906aa

Fix chat_template: add enable_thinking=true and math system prompt auto-injection

Browse files
Files changed (1) hide show
  1. chat_template.jinja +4 -0
chat_template.jinja CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  {%- if tools %}
2
  {{- '<|im_start|>system\n' }}
3
  {%- if messages[0].role == 'system' %}
 
1
+ {%- set enable_thinking = true %}
2
+ {%- if not (messages | selectattr("role", "equalto", "system") | list) %}
3
+ {%- set messages = [{"role": "system", "content": "You are a mathematical reasoning assistant. Solve problems step by step. Always end your response with your final answer wrapped in \\boxed{}, for example \\boxed{42}."}] + messages %}
4
+ {%- endif %}
5
  {%- if tools %}
6
  {{- '<|im_start|>system\n' }}
7
  {%- if messages[0].role == 'system' %}