Upload folder using huggingface_hub
Browse files- chat_template.jinja +131 -0
- config.json +80 -9
- generation_config.json +1 -1
- model-00001-of-00004.safetensors +2 -2
- model-00002-of-00004.safetensors +2 -2
- model-00003-of-00004.safetensors +2 -2
- model-00004-of-00004.safetensors +2 -2
- model.safetensors.index.json +0 -0
- recipe.yaml +16 -0
- tokenizer_config.json +0 -1
chat_template.jinja
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{% macro render_item_list(item_list, tag_name='required') %}
|
2 |
+
{%- if item_list is defined and item_list is iterable and item_list | length > 0 %}
|
3 |
+
{%- if tag_name %}{{- '\n<' ~ tag_name ~ '>' -}}{% endif %}
|
4 |
+
{{- '[' }}
|
5 |
+
{%- for item in item_list -%}
|
6 |
+
{%- if loop.index > 1 %}{{- ", "}}{% endif -%}
|
7 |
+
{%- if item is string -%}
|
8 |
+
{{ "`" ~ item ~ "`" }}
|
9 |
+
{%- else -%}
|
10 |
+
{{ item }}
|
11 |
+
{%- endif -%}
|
12 |
+
{%- endfor -%}
|
13 |
+
{{- ']' }}
|
14 |
+
{%- if tag_name %}{{- '</' ~ tag_name ~ '>' -}}{% endif %}
|
15 |
+
{%- endif %}
|
16 |
+
{% endmacro %}
|
17 |
+
|
18 |
+
{%- if messages[0]["role"] == "system" %}
|
19 |
+
{%- set system_message = messages[0]["content"] %}
|
20 |
+
{%- set loop_messages = messages[1:] %}
|
21 |
+
{%- else %}
|
22 |
+
{%- set loop_messages = messages %}
|
23 |
+
{%- endif %}
|
24 |
+
|
25 |
+
{%- if not tools is defined %}
|
26 |
+
{%- set tools = [] %}
|
27 |
+
{%- endif %}
|
28 |
+
|
29 |
+
{%- if system_message is defined %}
|
30 |
+
{{- "<|im_start|>system\n" + system_message }}
|
31 |
+
{%- else %}
|
32 |
+
{%- if tools is iterable and tools | length > 0 %}
|
33 |
+
{{- "<|im_start|>system\nYou are Qwen, a helpful AI assistant that can interact with a computer to solve tasks." }}
|
34 |
+
{%- endif %}
|
35 |
+
{%- endif %}
|
36 |
+
{%- if tools is iterable and tools | length > 0 %}
|
37 |
+
{{- "\n\nYou have access to the following functions:\n\n" }}
|
38 |
+
{{- "<tools>" }}
|
39 |
+
{%- for tool in tools %}
|
40 |
+
{%- if tool.function is defined %}
|
41 |
+
{%- set tool = tool.function %}
|
42 |
+
{%- endif %}
|
43 |
+
{{- "\n<function>\n<name>" ~ tool.name ~ "</name>" }}
|
44 |
+
{{- '\n<description>' ~ (tool.description | trim) ~ '</description>' }}
|
45 |
+
{{- '\n<parameters>' }}
|
46 |
+
{%- for param_name, param_fields in tool.parameters.properties|items %}
|
47 |
+
{{- '\n<parameter>' }}
|
48 |
+
{{- '\n<name>' ~ param_name ~ '</name>' }}
|
49 |
+
{%- if param_fields.type is defined %}
|
50 |
+
{{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
|
51 |
+
{%- endif %}
|
52 |
+
{%- if param_fields.description is defined %}
|
53 |
+
{{- '\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}
|
54 |
+
{%- endif %}
|
55 |
+
{{- render_item_list(param_fields.enum, 'enum') }}
|
56 |
+
{%- set handled_keys = ['type', 'description', 'enum', 'required'] %}
|
57 |
+
{%- for json_key in param_fields.keys() | reject("in", handled_keys) %}
|
58 |
+
{%- set normed_json_key = json_key | replace("-", "_") | replace(" ", "_") | replace("$", "") %}
|
59 |
+
{%- if param_fields[json_key] is mapping %}
|
60 |
+
{{- '\n<' ~ normed_json_key ~ '>' ~ (param_fields[json_key] | tojson | safe) ~ '</' ~ normed_json_key ~ '>' }}
|
61 |
+
{%- else %}
|
62 |
+
{{-'\n<' ~ normed_json_key ~ '>' ~ (param_fields[json_key] | string) ~ '</' ~ normed_json_key ~ '>' }}
|
63 |
+
{%- endif %}
|
64 |
+
{%- endfor %}
|
65 |
+
{{- render_item_list(param_fields.required, 'required') }}
|
66 |
+
{{- '\n</parameter>' }}
|
67 |
+
{%- endfor %}
|
68 |
+
{{- render_item_list(tool.parameters.required, 'required') }}
|
69 |
+
{{- '\n</parameters>' }}
|
70 |
+
{%- if tool.return is defined %}
|
71 |
+
{%- if tool.return is mapping %}
|
72 |
+
{{- '\n<return>' ~ (tool.return | tojson | safe) ~ '</return>' }}
|
73 |
+
{%- else %}
|
74 |
+
{{- '\n<return>' ~ (tool.return | string) ~ '</return>' }}
|
75 |
+
{%- endif %}
|
76 |
+
{%- endif %}
|
77 |
+
{{- '\n</function>' }}
|
78 |
+
{%- endfor %}
|
79 |
+
{{- "\n</tools>" }}
|
80 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
81 |
+
{%- endif %}
|
82 |
+
{%- if system_message is defined %}
|
83 |
+
{{- '<|im_end|>\n' }}
|
84 |
+
{%- else %}
|
85 |
+
{%- if tools is iterable and tools | length > 0 %}
|
86 |
+
{{- '<|im_end|>\n' }}
|
87 |
+
{%- endif %}
|
88 |
+
{%- endif %}
|
89 |
+
{%- for message in loop_messages %}
|
90 |
+
{%- if message.role == "assistant" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}
|
91 |
+
{{- '<|im_start|>' + message.role }}
|
92 |
+
{%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}
|
93 |
+
{{- '\n' + message.content | trim + '\n' }}
|
94 |
+
{%- endif %}
|
95 |
+
{%- for tool_call in message.tool_calls %}
|
96 |
+
{%- if tool_call.function is defined %}
|
97 |
+
{%- set tool_call = tool_call.function %}
|
98 |
+
{%- endif %}
|
99 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
100 |
+
{%- if tool_call.arguments is defined %}
|
101 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
102 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
103 |
+
{%- set args_value = args_value if args_value is string else args_value | string %}
|
104 |
+
{{- args_value }}
|
105 |
+
{{- '\n</parameter>\n' }}
|
106 |
+
{%- endfor %}
|
107 |
+
{%- endif %}
|
108 |
+
{{- '</function>\n</tool_call>' }}
|
109 |
+
{%- endfor %}
|
110 |
+
{{- '<|im_end|>\n' }}
|
111 |
+
{%- elif message.role == "user" or message.role == "system" or message.role == "assistant" %}
|
112 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
113 |
+
{%- elif message.role == "tool" %}
|
114 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
115 |
+
{{- '<|im_start|>user\n' }}
|
116 |
+
{%- endif %}
|
117 |
+
{{- '<tool_response>\n' }}
|
118 |
+
{{- message.content }}
|
119 |
+
{{- '\n</tool_response>\n' }}
|
120 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
121 |
+
{{- '<|im_end|>\n' }}
|
122 |
+
{%- elif loop.last %}
|
123 |
+
{{- '<|im_end|>\n' }}
|
124 |
+
{%- endif %}
|
125 |
+
{%- else %}
|
126 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>\n' }}
|
127 |
+
{%- endif %}
|
128 |
+
{%- endfor %}
|
129 |
+
{%- if add_generation_prompt %}
|
130 |
+
{{- '<|im_start|>assistant\n' }}
|
131 |
+
{%- endif %}
|
config.json
CHANGED
@@ -25,12 +25,83 @@
|
|
25 |
"output_router_logits": false,
|
26 |
"qkv_bias": false,
|
27 |
"quantization_config": {
|
28 |
-
"
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
},
|
35 |
"rms_norm_eps": 1e-06,
|
36 |
"rope_scaling": null,
|
@@ -40,9 +111,9 @@
|
|
40 |
"sliding_window": null,
|
41 |
"tie_word_embeddings": false,
|
42 |
"torch_dtype": "bfloat16",
|
43 |
-
"transformers_version": "4.
|
44 |
-
"use_cache":
|
45 |
"use_qk_norm": true,
|
46 |
"use_sliding_window": false,
|
47 |
"vocab_size": 151936
|
48 |
-
}
|
|
|
25 |
"output_router_logits": false,
|
26 |
"qkv_bias": false,
|
27 |
"quantization_config": {
|
28 |
+
"config_groups": {
|
29 |
+
"group_0": {
|
30 |
+
"input_activations": null,
|
31 |
+
"output_activations": null,
|
32 |
+
"targets": [
|
33 |
+
"Linear"
|
34 |
+
],
|
35 |
+
"weights": {
|
36 |
+
"actorder": null,
|
37 |
+
"block_structure": null,
|
38 |
+
"dynamic": false,
|
39 |
+
"group_size": 128,
|
40 |
+
"num_bits": 4,
|
41 |
+
"observer": "minmax",
|
42 |
+
"observer_kwargs": {},
|
43 |
+
"strategy": "group",
|
44 |
+
"symmetric": true,
|
45 |
+
"type": "int"
|
46 |
+
}
|
47 |
+
}
|
48 |
+
},
|
49 |
+
"format": "pack-quantized",
|
50 |
+
"global_compression_ratio": null,
|
51 |
+
"ignore": [
|
52 |
+
"model.layers.0.mlp.gate",
|
53 |
+
"model.layers.1.mlp.gate",
|
54 |
+
"model.layers.2.mlp.gate",
|
55 |
+
"model.layers.3.mlp.gate",
|
56 |
+
"model.layers.4.mlp.gate",
|
57 |
+
"model.layers.5.mlp.gate",
|
58 |
+
"model.layers.6.mlp.gate",
|
59 |
+
"model.layers.7.mlp.gate",
|
60 |
+
"model.layers.8.mlp.gate",
|
61 |
+
"model.layers.9.mlp.gate",
|
62 |
+
"model.layers.10.mlp.gate",
|
63 |
+
"model.layers.11.mlp.gate",
|
64 |
+
"model.layers.12.mlp.gate",
|
65 |
+
"model.layers.13.mlp.gate",
|
66 |
+
"model.layers.14.mlp.gate",
|
67 |
+
"model.layers.15.mlp.gate",
|
68 |
+
"model.layers.16.mlp.gate",
|
69 |
+
"model.layers.17.mlp.gate",
|
70 |
+
"model.layers.18.mlp.gate",
|
71 |
+
"model.layers.19.mlp.gate",
|
72 |
+
"model.layers.20.mlp.gate",
|
73 |
+
"model.layers.21.mlp.gate",
|
74 |
+
"model.layers.22.mlp.gate",
|
75 |
+
"model.layers.23.mlp.gate",
|
76 |
+
"model.layers.24.mlp.gate",
|
77 |
+
"model.layers.25.mlp.gate",
|
78 |
+
"model.layers.26.mlp.gate",
|
79 |
+
"model.layers.27.mlp.gate",
|
80 |
+
"model.layers.28.mlp.gate",
|
81 |
+
"model.layers.29.mlp.gate",
|
82 |
+
"model.layers.30.mlp.gate",
|
83 |
+
"model.layers.31.mlp.gate",
|
84 |
+
"model.layers.32.mlp.gate",
|
85 |
+
"model.layers.33.mlp.gate",
|
86 |
+
"model.layers.34.mlp.gate",
|
87 |
+
"model.layers.35.mlp.gate",
|
88 |
+
"model.layers.36.mlp.gate",
|
89 |
+
"model.layers.37.mlp.gate",
|
90 |
+
"model.layers.38.mlp.gate",
|
91 |
+
"model.layers.39.mlp.gate",
|
92 |
+
"model.layers.40.mlp.gate",
|
93 |
+
"model.layers.41.mlp.gate",
|
94 |
+
"model.layers.42.mlp.gate",
|
95 |
+
"model.layers.43.mlp.gate",
|
96 |
+
"model.layers.44.mlp.gate",
|
97 |
+
"model.layers.45.mlp.gate",
|
98 |
+
"model.layers.46.mlp.gate",
|
99 |
+
"model.layers.47.mlp.gate",
|
100 |
+
"lm_head"
|
101 |
+
],
|
102 |
+
"kv_cache_scheme": null,
|
103 |
+
"quant_method": "compressed-tensors",
|
104 |
+
"quantization_status": "compressed"
|
105 |
},
|
106 |
"rms_norm_eps": 1e-06,
|
107 |
"rope_scaling": null,
|
|
|
111 |
"sliding_window": null,
|
112 |
"tie_word_embeddings": false,
|
113 |
"torch_dtype": "bfloat16",
|
114 |
+
"transformers_version": "4.52.4",
|
115 |
+
"use_cache": true,
|
116 |
"use_qk_norm": true,
|
117 |
"use_sliding_window": false,
|
118 |
"vocab_size": 151936
|
119 |
+
}
|
generation_config.json
CHANGED
@@ -9,5 +9,5 @@
|
|
9 |
"temperature": 0.7,
|
10 |
"top_k": 20,
|
11 |
"top_p": 0.8,
|
12 |
-
"transformers_version": "4.
|
13 |
}
|
|
|
9 |
"temperature": 0.7,
|
10 |
"top_k": 20,
|
11 |
"top_p": 0.8,
|
12 |
+
"transformers_version": "4.52.4"
|
13 |
}
|
model-00001-of-00004.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:20547c567902e6374d770a37d4dca7b3bd591151a119c40b220b2aa87a618937
|
3 |
+
size 5001524144
|
model-00002-of-00004.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:76e6ba4c9b8f8422a39e4048941cfeccb333485195aa9eb9ccde58cb511889da
|
3 |
+
size 5001803304
|
model-00003-of-00004.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2d992ce423a3ce92363764b80a7a6d7cddea372b12ef149b3fcfcc52f365b4b2
|
3 |
+
size 5002084152
|
model-00004-of-00004.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b73e2455a4000a61f1f40aee4b7be1f6da46a66b10c3cc3443119a7462ab7f0
|
3 |
+
size 1687667728
|
model.safetensors.index.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
recipe.yaml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
default_stage:
|
2 |
+
default_modifiers:
|
3 |
+
AWQModifier:
|
4 |
+
targets: [Linear]
|
5 |
+
ignore: [lm_head, 're:.*mlp.gate$', 're:.*mlp.shared_expert_gate$']
|
6 |
+
scheme: W4A16
|
7 |
+
mappings:
|
8 |
+
- smooth_layer: re:.*input_layernorm$
|
9 |
+
balance_layers: ['re:.*q_proj$', 're:.*k_proj$', 're:.*v_proj$']
|
10 |
+
- smooth_layer: re:.*v_proj$
|
11 |
+
balance_layers: ['re:.*o_proj$']
|
12 |
+
- smooth_layer: re:.*post_attention_layernorm$
|
13 |
+
balance_layers: ['re:.*mlp.experts.*.gate_proj$', 're:.*mlp.experts.*.up_proj$']
|
14 |
+
- smooth_layer: re:.*up_proj$
|
15 |
+
balance_layers: ['re:.*down_proj$']
|
16 |
+
duo_scaling: true
|
tokenizer_config.json
CHANGED
@@ -227,7 +227,6 @@
|
|
227 |
"<|video_pad|>"
|
228 |
],
|
229 |
"bos_token": null,
|
230 |
-
"chat_template": "{% macro render_item_list(item_list, tag_name='required') %}\n {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}\n {%- if tag_name %}{{- '\\n<' ~ tag_name ~ '>' -}}{% endif %}\n {{- '[' }}\n {%- for item in item_list -%}\n {%- if loop.index > 1 %}{{- \", \"}}{% endif -%}\n {%- if item is string -%}\n {{ \"`\" ~ item ~ \"`\" }}\n {%- else -%}\n {{ item }}\n {%- endif -%}\n {%- endfor -%}\n {{- ']' }}\n {%- if tag_name %}{{- '</' ~ tag_name ~ '>' -}}{% endif %}\n {%- endif %}\n{% endmacro %}\n\n{%- if messages[0][\"role\"] == \"system\" %}\n {%- set system_message = messages[0][\"content\"] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n{%- if not tools is defined %}\n {%- set tools = [] %}\n{%- endif %}\n\n{%- if system_message is defined %}\n {{- \"<|im_start|>system\\n\" + system_message }}\n{%- else %}\n {%- if tools is iterable and tools | length > 0 %}\n {{- \"<|im_start|>system\\nYou are Qwen, a helpful AI assistant that can interact with a computer to solve tasks.\" }}\n {%- endif %}\n{%- endif %}\n{%- if tools is iterable and tools | length > 0 %}\n {{- \"\\n\\nYou have access to the following functions:\\n\\n\" }}\n {{- \"<tools>\" }}\n {%- for tool in tools %}\n {%- if tool.function is defined %}\n {%- set tool = tool.function %}\n {%- endif %}\n {{- \"\\n<function>\\n<name>\" ~ tool.name ~ \"</name>\" }}\n {{- '\\n<description>' ~ (tool.description | trim) ~ '</description>' }}\n {{- '\\n<parameters>' }}\n {%- for param_name, param_fields in tool.parameters.properties|items %}\n {{- '\\n<parameter>' }}\n {{- '\\n<name>' ~ param_name ~ '</name>' }}\n {%- if param_fields.type is defined %}\n {{- '\\n<type>' ~ (param_fields.type | string) ~ '</type>' }}\n {%- endif %}\n {%- if param_fields.description is defined %}\n {{- '\\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}\n {%- endif %}\n {{- render_item_list(param_fields.enum, 'enum') }}\n {%- set handled_keys = ['type', 'description', 'enum', 'required'] %}\n {%- for json_key in param_fields.keys() | reject(\"in\", handled_keys) %}\n {%- set normed_json_key = json_key | replace(\"-\", \"_\") | replace(\" \", \"_\") | replace(\"$\", \"\") %}\n {%- if param_fields[json_key] is mapping %}\n {{- '\\n<' ~ normed_json_key ~ '>' ~ (param_fields[json_key] | tojson | safe) ~ '</' ~ normed_json_key ~ '>' }}\n {%- else %}\n {{-'\\n<' ~ normed_json_key ~ '>' ~ (param_fields[json_key] | string) ~ '</' ~ normed_json_key ~ '>' }}\n {%- endif %}\n {%- endfor %}\n {{- render_item_list(param_fields.required, 'required') }}\n {{- '\\n</parameter>' }}\n {%- endfor %}\n {{- render_item_list(tool.parameters.required, 'required') }}\n {{- '\\n</parameters>' }}\n {%- if tool.return is defined %}\n {%- if tool.return is mapping %}\n {{- '\\n<return>' ~ (tool.return | tojson | safe) ~ '</return>' }}\n {%- else %}\n {{- '\\n<return>' ~ (tool.return | string) ~ '</return>' }}\n {%- endif %}\n {%- endif %}\n {{- '\\n</function>' }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n{%- endif %}\n{%- if system_message is defined %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if tools is iterable and tools | length > 0 %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in loop_messages %}\n {%- if message.role == \"assistant\" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}\n {{- '\\n' + message.content | trim + '\\n' }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- if tool_call.arguments is defined %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value if args_value is string else args_value | string %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"user\" or message.role == \"system\" or message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user\\n' }}\n {%- endif %}\n {{- '<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>\\n' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
|
231 |
"clean_up_tokenization_spaces": false,
|
232 |
"eos_token": "<|im_end|>",
|
233 |
"errors": "replace",
|
|
|
227 |
"<|video_pad|>"
|
228 |
],
|
229 |
"bos_token": null,
|
|
|
230 |
"clean_up_tokenization_spaces": false,
|
231 |
"eos_token": "<|im_end|>",
|
232 |
"errors": "replace",
|