lucianommartins commited on
Commit
4dd01bd
·
verified ·
1 Parent(s): 958f486

Fix chat template turn closure after tool-call-only turns

Browse files
Files changed (1) hide show
  1. chat_template.jinja +1 -1
chat_template.jinja CHANGED
@@ -368,7 +368,7 @@
368
  {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
369
  {{- '<|tool_response>' -}}
370
  {%- elif continues_into_next -%}
371
- {%- elif not (ns_tr_out.flag and not has_content) -%}
372
  {{- '<turn|>\n' -}}
373
  {%- endif -%}
374
 
 
368
  {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
369
  {{- '<|tool_response>' -}}
370
  {%- elif continues_into_next -%}
371
+ {%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
372
  {{- '<turn|>\n' -}}
373
  {%- endif -%}
374