zecanard commited on
Commit
32a715d
·
verified ·
1 Parent(s): cf4b85d

Adding Tools support.

Browse files
Files changed (1) hide show
  1. chat_template.jinja +10 -1
chat_template.jinja CHANGED
@@ -319,6 +319,15 @@
319
  {%- endif -%}
320
  {%- endfor -%}
321
  {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
 
 
 
 
 
 
 
 
 
322
  {%- else -%}
323
  {{- format_tool_response_block(ns_tname.name, tool_body) -}}
324
  {%- endif -%}
@@ -375,4 +384,4 @@
375
  {{- '<|channel>thought\n<channel|>' -}}
376
  {%- endif -%}
377
  {%- endif -%}
378
- {%- endif -%}
 
319
  {%- endif -%}
320
  {%- endfor -%}
321
  {{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
322
+ {%- for part in tool_body -%}
323
+ {%- if part.get('type') == 'image' -%}
324
+ {{- '<|image|>' -}}
325
+ {%- elif part.get('type') == 'audio' -%}
326
+ {{- '<|audio|>' -}}
327
+ {%- elif part.get('type') == 'video' -%}
328
+ {{- '<|video|>' -}}
329
+ {%- endif -%}
330
+ {%- endfor -%}
331
  {%- else -%}
332
  {{- format_tool_response_block(ns_tname.name, tool_body) -}}
333
  {%- endif -%}
 
384
  {{- '<|channel>thought\n<channel|>' -}}
385
  {%- endif -%}
386
  {%- endif -%}
387
+ {%- endif -%}