Upload openvino_detokenizer.xml with huggingface_hub
Browse files- openvino_detokenizer.xml +183 -0
openvino_detokenizer.xml
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<net name="detokenizer" version="11">
|
3 |
+
<layers>
|
4 |
+
<layer id="0" name="Parameter_2264482" type="Parameter" version="opset1">
|
5 |
+
<data shape="?,?" element_type="i64" />
|
6 |
+
<output>
|
7 |
+
<port id="0" precision="I64" names="Parameter_2264482">
|
8 |
+
<dim>-1</dim>
|
9 |
+
<dim>-1</dim>
|
10 |
+
</port>
|
11 |
+
</output>
|
12 |
+
</layer>
|
13 |
+
<layer id="1" name="Convert_2264493" 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_2264457" 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_2264458" 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="VocabDecoder_2264483" type="VocabDecoder" version="extension">
|
56 |
+
<data skip_tokens="151643, 151644, 151645, 151646, 151647, 151648, 151649, 151650, 151651, 151652, 151653, 151654, 151655, 151656" />
|
57 |
+
<input>
|
58 |
+
<port id="0" precision="I32">
|
59 |
+
<dim>-1</dim>
|
60 |
+
<dim>-1</dim>
|
61 |
+
</port>
|
62 |
+
<port id="1" precision="I32">
|
63 |
+
<dim>-1</dim>
|
64 |
+
</port>
|
65 |
+
<port id="2" precision="I32">
|
66 |
+
<dim>-1</dim>
|
67 |
+
</port>
|
68 |
+
<port id="3" precision="U8">
|
69 |
+
<dim>-1</dim>
|
70 |
+
</port>
|
71 |
+
</input>
|
72 |
+
<output>
|
73 |
+
<port id="4" precision="I32">
|
74 |
+
<dim>-1</dim>
|
75 |
+
</port>
|
76 |
+
<port id="5" precision="I32">
|
77 |
+
<dim>-1</dim>
|
78 |
+
</port>
|
79 |
+
<port id="6" precision="I32">
|
80 |
+
<dim>-1</dim>
|
81 |
+
</port>
|
82 |
+
<port id="7" precision="I32">
|
83 |
+
<dim>-1</dim>
|
84 |
+
</port>
|
85 |
+
<port id="8" precision="U8">
|
86 |
+
<dim>-1</dim>
|
87 |
+
</port>
|
88 |
+
</output>
|
89 |
+
</layer>
|
90 |
+
<layer id="5" name="FuzeRagged_2264484" type="FuzeRagged" version="extension">
|
91 |
+
<input>
|
92 |
+
<port id="0" precision="I32">
|
93 |
+
<dim>-1</dim>
|
94 |
+
</port>
|
95 |
+
<port id="1" precision="I32">
|
96 |
+
<dim>-1</dim>
|
97 |
+
</port>
|
98 |
+
<port id="2" precision="I32">
|
99 |
+
<dim>-1</dim>
|
100 |
+
</port>
|
101 |
+
<port id="3" precision="I32">
|
102 |
+
<dim>-1</dim>
|
103 |
+
</port>
|
104 |
+
</input>
|
105 |
+
<output>
|
106 |
+
<port id="4" precision="I32">
|
107 |
+
<dim>-1</dim>
|
108 |
+
</port>
|
109 |
+
<port id="5" precision="I32">
|
110 |
+
<dim>-1</dim>
|
111 |
+
</port>
|
112 |
+
</output>
|
113 |
+
</layer>
|
114 |
+
<layer id="6" name="StringTensorPack_2264485" type="StringTensorPack" version="extension">
|
115 |
+
<data mode="begins_ends" />
|
116 |
+
<input>
|
117 |
+
<port id="0" precision="I32">
|
118 |
+
<dim>-1</dim>
|
119 |
+
</port>
|
120 |
+
<port id="1" precision="I32">
|
121 |
+
<dim>-1</dim>
|
122 |
+
</port>
|
123 |
+
<port id="2" precision="U8">
|
124 |
+
<dim>-1</dim>
|
125 |
+
</port>
|
126 |
+
</input>
|
127 |
+
<output>
|
128 |
+
<port id="3" precision="STRING" names="string_output">
|
129 |
+
<dim>-1</dim>
|
130 |
+
</port>
|
131 |
+
</output>
|
132 |
+
</layer>
|
133 |
+
<layer id="7" name="Result_2264486" type="Result" version="opset1">
|
134 |
+
<input>
|
135 |
+
<port id="0" precision="STRING">
|
136 |
+
<dim>-1</dim>
|
137 |
+
</port>
|
138 |
+
</input>
|
139 |
+
</layer>
|
140 |
+
</layers>
|
141 |
+
<edges>
|
142 |
+
<edge from-layer="0" from-port="0" to-layer="1" to-port="0" />
|
143 |
+
<edge from-layer="1" from-port="1" to-layer="4" to-port="0" />
|
144 |
+
<edge from-layer="2" from-port="0" to-layer="3" to-port="0" />
|
145 |
+
<edge from-layer="3" from-port="1" to-layer="4" to-port="1" />
|
146 |
+
<edge from-layer="3" from-port="2" to-layer="4" to-port="2" />
|
147 |
+
<edge from-layer="3" from-port="3" to-layer="4" to-port="3" />
|
148 |
+
<edge from-layer="4" from-port="4" to-layer="5" to-port="0" />
|
149 |
+
<edge from-layer="4" from-port="5" to-layer="5" to-port="1" />
|
150 |
+
<edge from-layer="4" from-port="6" to-layer="5" to-port="2" />
|
151 |
+
<edge from-layer="4" from-port="7" to-layer="5" to-port="3" />
|
152 |
+
<edge from-layer="4" from-port="8" to-layer="6" to-port="2" />
|
153 |
+
<edge from-layer="5" from-port="4" to-layer="6" to-port="0" />
|
154 |
+
<edge from-layer="5" from-port="5" to-layer="6" to-port="1" />
|
155 |
+
<edge from-layer="6" from-port="3" to-layer="7" to-port="0" />
|
156 |
+
</edges>
|
157 |
+
<rt_info>
|
158 |
+
<add_attention_mask value="True" />
|
159 |
+
<add_prefix_space />
|
160 |
+
<add_special_tokens value="True" />
|
161 |
+
<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 %} " />
|
162 |
+
<clean_up_tokenization_spaces />
|
163 |
+
<detokenizer_input_type value="i64" />
|
164 |
+
<eos_token_id value="151645" />
|
165 |
+
<handle_special_tokens_with_re />
|
166 |
+
<number_of_inputs value="1" />
|
167 |
+
<openvino_tokenizers_version value="2025.0.0.0.dev20241112" />
|
168 |
+
<openvino_version value="2025.0.0.dev20241112" />
|
169 |
+
<original_tokenizer_class value="<class 'transformers.models.qwen2.tokenization_qwen2_fast.Qwen2TokenizerFast'>" />
|
170 |
+
<pad_token_id value="151643" />
|
171 |
+
<sentencepiece_version value="0.2.0" />
|
172 |
+
<skip_special_tokens value="True" />
|
173 |
+
<streaming_detokenizer value="False" />
|
174 |
+
<tiktoken_version value="0.8.0" />
|
175 |
+
<tokenizer_output_type value="i64" />
|
176 |
+
<tokenizers_version value="0.20.1" />
|
177 |
+
<transformers_version value="4.45.2" />
|
178 |
+
<use_max_padding value="False" />
|
179 |
+
<use_sentencepiece_backend value="False" />
|
180 |
+
<utf8_replace_mode />
|
181 |
+
<with_detokenizer value="True" />
|
182 |
+
</rt_info>
|
183 |
+
</net>
|