chat template: add support for enable_thinking

#22
Files changed (1) hide show
  1. chat_template.jinja +3 -2
chat_template.jinja CHANGED
@@ -1,6 +1,6 @@
1
  [gMASK]<sop>
2
  {%- set effective_reasoning_effort = reasoning_effort if reasoning_effort is defined and reasoning_effort in ['low', 'high'] else 'max' -%}
3
- {%- if effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}
4
  {%- set clear_thinking = clear_thinking if clear_thinking is defined else false -%}
5
  {%- if tools -%}
6
  {%- macro tool_to_json(tool) -%}
@@ -251,5 +251,6 @@ For each function call, output the function name and arguments within the follow
251
  {%- endif -%}
252
  {%- endfor -%}
253
  {%- if add_generation_prompt -%}
254
- <|assistant|>{{- '<think>' -}}
255
  {%- endif -%}
 
 
1
  [gMASK]<sop>
2
  {%- set effective_reasoning_effort = reasoning_effort if reasoning_effort is defined and reasoning_effort in ['low', 'high'] else 'max' -%}
3
+ {%- if (enable_thinking is not defined or enable_thinking) and effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}
4
  {%- set clear_thinking = clear_thinking if clear_thinking is defined else false -%}
5
  {%- if tools -%}
6
  {%- macro tool_to_json(tool) -%}
 
251
  {%- endif -%}
252
  {%- endfor -%}
253
  {%- if add_generation_prompt -%}
254
+ <|assistant|>{{- '<think></think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
255
  {%- endif -%}
256
+