chat template: tool call fix?

#16
by sbrandeis HF Staff - opened
Files changed (1) hide show
  1. chat_template.jinja +3 -3
chat_template.jinja CHANGED
@@ -75,13 +75,13 @@
75
  {%- elif message.role == "assistant" -%}
76
  {% generation %}
77
  {%- if reasoning_mode == "/think" -%}
78
- {{ "<|im_start|>assistant\n" + content.lstrip("\n") + "<|im_end|>\n" }}
79
  {%- else -%}
80
- {{ "<|im_start|>assistant\n" + "<think>\n\n</think>\n" + content.lstrip("\n") + "<|im_end|>\n" }}
81
  {%- endif -%}
82
  {% endgeneration %}
83
  {%- elif message.role == "tool" -%}
84
- {{ "<|im_start|>" + "user\n" + content + "<|im_end|>\n" }}
85
  {%- endif -%}
86
  {%- endfor -%}
87
  {# ───── generation prompt ───── #}
 
75
  {%- elif message.role == "assistant" -%}
76
  {% generation %}
77
  {%- if reasoning_mode == "/think" -%}
78
+ {{ "<|im_start|>" + message.role + "\n" + content.lstrip("\n") + "<|im_end|>\n" }}
79
  {%- else -%}
80
+ {{ "<|im_start|>" + message.role + "\n" + "<think>\n\n</think>\n" + content.lstrip("\n") + "<|im_end|>\n" }}
81
  {%- endif -%}
82
  {% endgeneration %}
83
  {%- elif message.role == "tool" -%}
84
+ {{ "<|im_start|>" + message.role + "\n" + content + "<|im_end|>\n" }}
85
  {%- endif -%}
86
  {%- endfor -%}
87
  {# ───── generation prompt ───── #}