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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<net name="detokenizer" version="11">
|
3 |
+
<layers>
|
4 |
+
<layer id="0" name="Parameter_219117" type="Parameter" version="opset1">
|
5 |
+
<data shape="?,?" element_type="i64" />
|
6 |
+
<output>
|
7 |
+
<port id="0" precision="I64" names="Parameter_219117">
|
8 |
+
<dim>-1</dim>
|
9 |
+
<dim>-1</dim>
|
10 |
+
</port>
|
11 |
+
</output>
|
12 |
+
</layer>
|
13 |
+
<layer id="1" name="Convert_219133" type="Convert" version="opset1">
|
14 |
+
<data destination_type="i32" />
|
15 |
+
<input>
|
16 |
+
<port id="0" precision="I64">
|
17 |
+
<dim>-1</dim>
|
18 |
+
<dim>-1</dim>
|
19 |
+
</port>
|
20 |
+
</input>
|
21 |
+
<output>
|
22 |
+
<port id="1" precision="I32">
|
23 |
+
<dim>-1</dim>
|
24 |
+
<dim>-1</dim>
|
25 |
+
</port>
|
26 |
+
</output>
|
27 |
+
</layer>
|
28 |
+
<layer id="2" name="Constant_219092" type="Const" version="opset1">
|
29 |
+
<data element_type="u8" shape="1582931" offset="0" size="1582931" />
|
30 |
+
<output>
|
31 |
+
<port id="0" precision="U8">
|
32 |
+
<dim>1582931</dim>
|
33 |
+
</port>
|
34 |
+
</output>
|
35 |
+
</layer>
|
36 |
+
<layer id="3" name="StringTensorUnpack_219093" type="StringTensorUnpack" version="extension">
|
37 |
+
<data mode="begins_ends" />
|
38 |
+
<input>
|
39 |
+
<port id="0" precision="U8">
|
40 |
+
<dim>1582931</dim>
|
41 |
+
</port>
|
42 |
+
</input>
|
43 |
+
<output>
|
44 |
+
<port id="1" precision="I32">
|
45 |
+
<dim>-1</dim>
|
46 |
+
</port>
|
47 |
+
<port id="2" precision="I32">
|
48 |
+
<dim>-1</dim>
|
49 |
+
</port>
|
50 |
+
<port id="3" precision="U8">
|
51 |
+
<dim>-1</dim>
|
52 |
+
</port>
|
53 |
+
</output>
|
54 |
+
</layer>
|
55 |
+
<layer id="4" name="Constant_219121" type="Const" version="opset1">
|
56 |
+
<data element_type="i32" shape="14" offset="1582931" size="56" />
|
57 |
+
<output>
|
58 |
+
<port id="0" precision="I32">
|
59 |
+
<dim>14</dim>
|
60 |
+
</port>
|
61 |
+
</output>
|
62 |
+
</layer>
|
63 |
+
<layer id="5" name="Constant_219119" type="Const" version="opset1">
|
64 |
+
<data element_type="i32" shape="1" offset="1582987" size="4" />
|
65 |
+
<output>
|
66 |
+
<port id="0" precision="I32">
|
67 |
+
<dim>1</dim>
|
68 |
+
</port>
|
69 |
+
</output>
|
70 |
+
</layer>
|
71 |
+
<layer id="6" name="Constant_219118" type="Const" version="opset1">
|
72 |
+
<data element_type="i32" shape="1" offset="1582991" size="4" />
|
73 |
+
<output>
|
74 |
+
<port id="0" precision="I32">
|
75 |
+
<dim>1</dim>
|
76 |
+
</port>
|
77 |
+
</output>
|
78 |
+
</layer>
|
79 |
+
<layer id="7" name="Constant_219120" type="Const" version="opset1">
|
80 |
+
<data element_type="i32" shape="1" offset="1582995" size="4" />
|
81 |
+
<output>
|
82 |
+
<port id="0" precision="I32">
|
83 |
+
<dim>1</dim>
|
84 |
+
</port>
|
85 |
+
</output>
|
86 |
+
</layer>
|
87 |
+
<layer id="8" name="Constant_219123" type="Const" version="opset1">
|
88 |
+
<data element_type="i64" shape="1" offset="1582999" size="8" />
|
89 |
+
<output>
|
90 |
+
<port id="0" precision="I64">
|
91 |
+
<dim>1</dim>
|
92 |
+
</port>
|
93 |
+
</output>
|
94 |
+
</layer>
|
95 |
+
<layer id="9" name="Slice_219122" type="Slice" version="opset8">
|
96 |
+
<input>
|
97 |
+
<port id="0" precision="I32">
|
98 |
+
<dim>14</dim>
|
99 |
+
</port>
|
100 |
+
<port id="1" precision="I32">
|
101 |
+
<dim>1</dim>
|
102 |
+
</port>
|
103 |
+
<port id="2" precision="I32">
|
104 |
+
<dim>1</dim>
|
105 |
+
</port>
|
106 |
+
<port id="3" precision="I32">
|
107 |
+
<dim>1</dim>
|
108 |
+
</port>
|
109 |
+
<port id="4" precision="I64">
|
110 |
+
<dim>1</dim>
|
111 |
+
</port>
|
112 |
+
</input>
|
113 |
+
<output>
|
114 |
+
<port id="5" precision="I32">
|
115 |
+
<dim>14</dim>
|
116 |
+
</port>
|
117 |
+
</output>
|
118 |
+
</layer>
|
119 |
+
<layer id="10" name="VocabDecoder_219124" type="VocabDecoder" version="extension">
|
120 |
+
<data skip_tokens="" />
|
121 |
+
<input>
|
122 |
+
<port id="0" precision="I32">
|
123 |
+
<dim>-1</dim>
|
124 |
+
<dim>-1</dim>
|
125 |
+
</port>
|
126 |
+
<port id="1" precision="I32">
|
127 |
+
<dim>-1</dim>
|
128 |
+
</port>
|
129 |
+
<port id="2" precision="I32">
|
130 |
+
<dim>-1</dim>
|
131 |
+
</port>
|
132 |
+
<port id="3" precision="U8">
|
133 |
+
<dim>-1</dim>
|
134 |
+
</port>
|
135 |
+
<port id="4" precision="I32">
|
136 |
+
<dim>14</dim>
|
137 |
+
</port>
|
138 |
+
</input>
|
139 |
+
<output>
|
140 |
+
<port id="5" precision="I32">
|
141 |
+
<dim>-1</dim>
|
142 |
+
</port>
|
143 |
+
<port id="6" precision="I32">
|
144 |
+
<dim>-1</dim>
|
145 |
+
</port>
|
146 |
+
<port id="7" precision="I32">
|
147 |
+
<dim>-1</dim>
|
148 |
+
</port>
|
149 |
+
<port id="8" precision="I32">
|
150 |
+
<dim>-1</dim>
|
151 |
+
</port>
|
152 |
+
<port id="9" precision="U8">
|
153 |
+
<dim>-1</dim>
|
154 |
+
</port>
|
155 |
+
</output>
|
156 |
+
</layer>
|
157 |
+
<layer id="11" name="FuzeRagged_219125" type="FuzeRagged" version="extension">
|
158 |
+
<input>
|
159 |
+
<port id="0" precision="I32">
|
160 |
+
<dim>-1</dim>
|
161 |
+
</port>
|
162 |
+
<port id="1" precision="I32">
|
163 |
+
<dim>-1</dim>
|
164 |
+
</port>
|
165 |
+
<port id="2" precision="I32">
|
166 |
+
<dim>-1</dim>
|
167 |
+
</port>
|
168 |
+
<port id="3" precision="I32">
|
169 |
+
<dim>-1</dim>
|
170 |
+
</port>
|
171 |
+
</input>
|
172 |
+
<output>
|
173 |
+
<port id="4" precision="I32">
|
174 |
+
<dim>-1</dim>
|
175 |
+
</port>
|
176 |
+
<port id="5" precision="I32">
|
177 |
+
<dim>-1</dim>
|
178 |
+
</port>
|
179 |
+
</output>
|
180 |
+
</layer>
|
181 |
+
<layer id="12" name="UTF8Validate_219126" type="UTF8Validate" version="extension">
|
182 |
+
<data replace_mode="true" />
|
183 |
+
<input>
|
184 |
+
<port id="0" precision="I32">
|
185 |
+
<dim>-1</dim>
|
186 |
+
</port>
|
187 |
+
<port id="1" precision="I32">
|
188 |
+
<dim>-1</dim>
|
189 |
+
</port>
|
190 |
+
<port id="2" precision="U8">
|
191 |
+
<dim>-1</dim>
|
192 |
+
</port>
|
193 |
+
</input>
|
194 |
+
<output>
|
195 |
+
<port id="3" precision="I32">
|
196 |
+
<dim>-1</dim>
|
197 |
+
</port>
|
198 |
+
<port id="4" precision="I32">
|
199 |
+
<dim>-1</dim>
|
200 |
+
</port>
|
201 |
+
<port id="5" precision="U8">
|
202 |
+
<dim>-1</dim>
|
203 |
+
</port>
|
204 |
+
</output>
|
205 |
+
</layer>
|
206 |
+
<layer id="13" name="StringTensorPack_219127" type="StringTensorPack" version="extension">
|
207 |
+
<data mode="begins_ends" />
|
208 |
+
<input>
|
209 |
+
<port id="0" precision="I32">
|
210 |
+
<dim>-1</dim>
|
211 |
+
</port>
|
212 |
+
<port id="1" precision="I32">
|
213 |
+
<dim>-1</dim>
|
214 |
+
</port>
|
215 |
+
<port id="2" precision="U8">
|
216 |
+
<dim>-1</dim>
|
217 |
+
</port>
|
218 |
+
</input>
|
219 |
+
<output>
|
220 |
+
<port id="3" precision="STRING" names="string_output">
|
221 |
+
<dim>-1</dim>
|
222 |
+
</port>
|
223 |
+
</output>
|
224 |
+
</layer>
|
225 |
+
<layer id="14" name="Result_219128" type="Result" version="opset1">
|
226 |
+
<input>
|
227 |
+
<port id="0" precision="STRING">
|
228 |
+
<dim>-1</dim>
|
229 |
+
</port>
|
230 |
+
</input>
|
231 |
+
</layer>
|
232 |
+
</layers>
|
233 |
+
<edges>
|
234 |
+
<edge from-layer="0" from-port="0" to-layer="1" to-port="0" />
|
235 |
+
<edge from-layer="1" from-port="1" to-layer="10" to-port="0" />
|
236 |
+
<edge from-layer="2" from-port="0" to-layer="3" to-port="0" />
|
237 |
+
<edge from-layer="3" from-port="1" to-layer="10" to-port="1" />
|
238 |
+
<edge from-layer="3" from-port="2" to-layer="10" to-port="2" />
|
239 |
+
<edge from-layer="3" from-port="3" to-layer="10" to-port="3" />
|
240 |
+
<edge from-layer="4" from-port="0" to-layer="9" to-port="0" />
|
241 |
+
<edge from-layer="5" from-port="0" to-layer="9" to-port="1" />
|
242 |
+
<edge from-layer="6" from-port="0" to-layer="9" to-port="2" />
|
243 |
+
<edge from-layer="7" from-port="0" to-layer="9" to-port="3" />
|
244 |
+
<edge from-layer="8" from-port="0" to-layer="9" to-port="4" />
|
245 |
+
<edge from-layer="9" from-port="5" to-layer="10" to-port="4" />
|
246 |
+
<edge from-layer="10" from-port="5" to-layer="11" to-port="0" />
|
247 |
+
<edge from-layer="10" from-port="6" to-layer="11" to-port="1" />
|
248 |
+
<edge from-layer="10" from-port="7" to-layer="11" to-port="2" />
|
249 |
+
<edge from-layer="10" from-port="8" to-layer="11" to-port="3" />
|
250 |
+
<edge from-layer="10" from-port="9" to-layer="12" to-port="2" />
|
251 |
+
<edge from-layer="11" from-port="4" to-layer="12" to-port="0" />
|
252 |
+
<edge from-layer="11" from-port="5" to-layer="12" to-port="1" />
|
253 |
+
<edge from-layer="12" from-port="3" to-layer="13" to-port="0" />
|
254 |
+
<edge from-layer="12" from-port="4" to-layer="13" to-port="1" />
|
255 |
+
<edge from-layer="12" from-port="5" to-layer="13" to-port="2" />
|
256 |
+
<edge from-layer="13" from-port="3" to-layer="14" to-port="0" />
|
257 |
+
</edges>
|
258 |
+
<rt_info>
|
259 |
+
<add_attention_mask value="True" />
|
260 |
+
<add_prefix_space />
|
261 |
+
<add_special_tokens value="True" />
|
262 |
+
<chat_template value="{%- if tools %} {{- '<|im_start|>system\n' }} {%- if messages[0]['role'] == 'system' %} {{- messages[0]['content'] }} {%- else %} {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }} {%- endif %} {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }} {%- for tool in tools %} {{- "\n" }} {{- tool | tojson }} {%- endfor %} {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{{\"name\": <function-name>, \"arguments\": <args-json-object>}}\n</tool_call><|im_end|>\n" }} {%- else %} {%- if messages[0]['role'] == 'system' %} {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }} {%- else %} {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }} {%- endif %} {%- endif %} {%- for message in messages %} {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %} {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }} {%- elif message.role == "assistant" %} {{- '<|im_start|>' + message.role }} {%- if message.content %} {{- '\n' + message.content }} {%- endif %} {%- for tool_call in message.tool_calls %} {%- if tool_call.function is defined %} {%- set tool_call = tool_call.function %} {%- endif %} {{- '\n<tool_call>\n{"name": "' }} {{- tool_call.name }} {{- '", "arguments": ' }} {{- tool_call.arguments | tojson }} {{- '}\n</tool_call>' }} {%- endfor %} {{- '<|im_end|>\n' }} {%- elif message.role == "tool" %} {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' }} {{- message.content }} {{- '\n</tool_response>' }} {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} {{- '<|im_end|>\n' }} {%- endif %} {%- endif %} {%- endfor %} {%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }} {%- endif %} " />
|
263 |
+
<clean_up_tokenization_spaces />
|
264 |
+
<detokenizer_input_type value="i64" />
|
265 |
+
<eos_token_id value="151645" />
|
266 |
+
<handle_special_tokens_with_re />
|
267 |
+
<number_of_inputs value="1" />
|
268 |
+
<openvino_tokenizers_version value="2025.0.0.0.dev20241220" />
|
269 |
+
<openvino_version value="2025.0.0.dev20241220" />
|
270 |
+
<original_tokenizer_class value="<class 'transformers.models.qwen2.tokenization_qwen2_fast.Qwen2TokenizerFast'>" />
|
271 |
+
<pad_token_id value="151643" />
|
272 |
+
<sentencepiece_version value="0.2.0" />
|
273 |
+
<skip_special_tokens value="True" />
|
274 |
+
<streaming_detokenizer value="False" />
|
275 |
+
<tiktoken_version value="0.8.0" />
|
276 |
+
<tokenizer_output_type value="i64" />
|
277 |
+
<tokenizers_version value="0.20.3" />
|
278 |
+
<transformers_version value="4.46.3" />
|
279 |
+
<use_max_padding value="False" />
|
280 |
+
<use_sentencepiece_backend value="False" />
|
281 |
+
<utf8_replace_mode value="replace" />
|
282 |
+
<with_detokenizer value="True" />
|
283 |
+
</rt_info>
|
284 |
+
</net>
|