Fix chat_template
Browse fileshttps://github.com/ochafik/minja/pull/7#issuecomment-3478459580
- chat_template.jinja +5 -1
chat_template.jinja
CHANGED
|
@@ -118,7 +118,11 @@
|
|
| 118 |
{%- endfor -%}
|
| 119 |
|
| 120 |
{{- toolcall_end_token}}
|
| 121 |
-
{%-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
{%- else -%}
|
| 123 |
{%- set last_tool_call.name = none -%}
|
| 124 |
{%- endif -%}
|
|
|
|
| 118 |
{%- endfor -%}
|
| 119 |
|
| 120 |
{{- toolcall_end_token}}
|
| 121 |
+
{%- if message.tool_calls[-1].function -%}
|
| 122 |
+
{%- set last_tool_call.name = message.tool_calls[-1].function.name -%}
|
| 123 |
+
{%- else -%}
|
| 124 |
+
{%- set last_tool_call.name = message.tool_calls[-1].name -%}
|
| 125 |
+
{%- endif -%}
|
| 126 |
{%- else -%}
|
| 127 |
{%- set last_tool_call.name = none -%}
|
| 128 |
{%- endif -%}
|