Text Generation
Transformers
Safetensors
minimax_m2
conversational
custom_code
fp8
rogeryoungh commited on
Commit
41ba56e
·
verified ·
1 Parent(s): c2b7e11

Fix chat_template

Browse files

https://github.com/ochafik/minja/pull/7#issuecomment-3478459580

Files changed (1) hide show
  1. chat_template.jinja +5 -1
chat_template.jinja CHANGED
@@ -118,7 +118,11 @@
118
  {%- endfor -%}
119
 
120
  {{- toolcall_end_token}}
121
- {%- set last_tool_call.name = message.tool_calls[-1].name -%}
 
 
 
 
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 -%}