Text Generation
Transformers
Safetensors
minimax_m2
conversational
custom_code
fp8
rogeryoungh commited on
Commit
9354a5c
·
verified ·
1 Parent(s): de27025

Fix chat_template (#32)

Browse files

- Fix chat_template (41ba56e3cd1188531e34860a18aed92b0cdc42bc)
- fix: fix if message.content is none (08db92364daa5f1a8e3939edd6ab2149c7bada46)

Files changed (1) hide show
  1. chat_template.jinja +7 -1
chat_template.jinja CHANGED
@@ -18,6 +18,8 @@
18
  {{- item }}
19
  {%- endif -%}
20
  {%- endfor -%}
 
 
21
  {%- else -%}
22
  {{- content }}
23
  {%- endif -%}
@@ -118,7 +120,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 -%}
 
18
  {{- item }}
19
  {%- endif -%}
20
  {%- endfor -%}
21
+ {%- elif content is none -%}
22
+ {{- '' }}
23
  {%- else -%}
24
  {{- content }}
25
  {%- endif -%}
 
120
  {%- endfor -%}
121
 
122
  {{- toolcall_end_token}}
123
+ {%- if message.tool_calls[-1].function -%}
124
+ {%- set last_tool_call.name = message.tool_calls[-1].function.name -%}
125
+ {%- else -%}
126
+ {%- set last_tool_call.name = message.tool_calls[-1].name -%}
127
+ {%- endif -%}
128
  {%- else -%}
129
  {%- set last_tool_call.name = none -%}
130
  {%- endif -%}