lucianommartins commited on
Commit
3ba05ed
·
verified ·
1 Parent(s): acdb1de

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
@@ -369,7 +369,7 @@
369
  {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
370
  {{- '<|tool_response>' -}}
371
  {%- elif continues_into_next -%}
372
- {%- elif not (ns_tr_out.flag and not has_content) -%}
373
  {{- '<turn|>\n' -}}
374
  {%- endif -%}
375
 
 
369
  {%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
370
  {{- '<|tool_response>' -}}
371
  {%- elif continues_into_next -%}
372
+ {%- elif not (ns_tr_out.flag and not has_content and not next_nt.found) -%}
373
  {{- '<turn|>\n' -}}
374
  {%- endif -%}
375