Update chat_template.jinja

#20
by dluthyc - opened
Files changed (1) hide show
  1. chat_template.jinja +3 -1
chat_template.jinja CHANGED
@@ -127,7 +127,9 @@
127
  {{- '</function>\n</tool_call>' }}
128
  {%- endfor %}
129
  {%- endif %}
130
- {{- '<|im_end|>\n' }}
 
 
131
  {%- elif message.role == "tool" %}
132
  {%- if loop.previtem and loop.previtem.role != "tool" %}
133
  {{- '<|im_start|>user' }}
 
127
  {{- '</function>\n</tool_call>' }}
128
  {%- endfor %}
129
  {%- endif %}
130
+ {%- if not (loop.last and continue_final_message is defined and continue_final_message) %}
131
+ {{- '<|im_end|>\n' }}
132
+ {%- endif %}
133
  {%- elif message.role == "tool" %}
134
  {%- if loop.previtem and loop.previtem.role != "tool" %}
135
  {{- '<|im_start|>user' }}