# Proposal: fix inconsistent thought-channel convention in `chat_template.jinja` (`add_generation_prompt`)

#141
Files changed (1) hide show
  1. chat_template.jinja +6 -4
chat_template.jinja CHANGED
@@ -381,10 +381,12 @@
381
  {%- if add_generation_prompt -%}
382
  {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
383
  {{- '<|turn>model\n' -}}
384
- {%- if not enable_thinking -%}
 
 
 
 
385
  {{- '<|channel>thought\n<channel|>' -}}
386
  {%- endif -%}
387
- {%- elif ns.prev_message_type == 'tool_response' and enable_thinking -%}
388
- {{- '<|channel>thought\n' -}}
389
  {%- endif -%}
390
- {%- endif -%}
 
381
  {%- if add_generation_prompt -%}
382
  {%- if ns.prev_message_type != 'tool_response' and ns.prev_message_type != 'tool_call' -%}
383
  {{- '<|turn>model\n' -}}
384
+ {%- endif -%}
385
+ {%- if ns.prev_message_type != 'tool_call' -%}
386
+ {%- if enable_thinking -%}
387
+ {{- '<|channel>thought\n' -}}
388
+ {%- else -%}
389
  {{- '<|channel>thought\n<channel|>' -}}
390
  {%- endif -%}
 
 
391
  {%- endif -%}
392
+ {%- endif -%}