Toots commited on
Commit
e2e7758
·
verified ·
1 Parent(s): b9c30a5

Upload chat_template.jinja with huggingface_hub

Browse files
Files changed (1) hide show
  1. chat_template.jinja +4 -4
chat_template.jinja CHANGED
@@ -8,7 +8,7 @@ You may call one or more functions to assist with the user query.
8
  You are provided with function signatures within <tools></tools> XML tags:
9
  <tools>
10
  {% for tool in tools %}
11
- {{ tool | tojson(ensure_ascii=False) }}
12
  {% endfor %}
13
  </tools>
14
 
@@ -53,8 +53,8 @@ For each function call, output the function name and arguments within the follow
53
  {%- set reasoning_content = m.reasoning_content %}
54
  {%- else %}
55
  {%- if '</think>' in content %}
56
- {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
57
- {%- set content = content.split('</think>')[-1].lstrip('\n') %}
58
  {%- endif %}
59
  {%- endif %}
60
  {%- if loop.index0 > ns.last_user_index and reasoning_content -%}
@@ -74,7 +74,7 @@ For each function call, output the function name and arguments within the follow
74
  {% set _args = tc.arguments %}
75
  {% for k, v in _args.items() %}
76
  <arg_key>{{ k }}</arg_key>
77
- <arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>
78
  {% endfor %}
79
  </tool_call>{% endfor %}
80
  {% endif %}
 
8
  You are provided with function signatures within <tools></tools> XML tags:
9
  <tools>
10
  {% for tool in tools %}
11
+ {{ tool | tojson|string }}
12
  {% endfor %}
13
  </tools>
14
 
 
53
  {%- set reasoning_content = m.reasoning_content %}
54
  {%- else %}
55
  {%- if '</think>' in content %}
56
+ {%- set reasoning_content = ((content.split('</think>')|first).rstrip('\n').split('<think>')|last).lstrip('\n') %}
57
+ {%- set content = (content.split('</think>')|last).lstrip('\n') %}
58
  {%- endif %}
59
  {%- endif %}
60
  {%- if loop.index0 > ns.last_user_index and reasoning_content -%}
 
74
  {% set _args = tc.arguments %}
75
  {% for k, v in _args.items() %}
76
  <arg_key>{{ k }}</arg_key>
77
+ <arg_value>{{ v | tojson|string if v is not string else v }}</arg_value>
78
  {% endfor %}
79
  </tool_call>{% endfor %}
80
  {% endif %}