AIFunOver commited on
Commit
68e46a7
1 Parent(s): 74d9dfd

Upload openvino_detokenizer.xml with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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_1687644" type="Parameter" version="opset1">
5
+ <data shape="?,?" element_type="i64" />
6
+ <output>
7
+ <port id="0" precision="I64" names="Parameter_1687644">
8
+ <dim>-1</dim>
9
+ <dim>-1</dim>
10
+ </port>
11
+ </output>
12
+ </layer>
13
+ <layer id="1" name="Convert_1687655" 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_1687619" 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_1687620" 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_1687645" 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_1687646" 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_1687647" 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_1687648" 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 %}&#10; {{- '&lt;|im_start|>system\n' }}&#10; {%- if messages[0]['role'] == 'system' %}&#10; {{- messages[0]['content'] }}&#10; {%- else %}&#10; {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}&#10; {%- endif %}&#10; {{- &quot;\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 &lt;tools>&lt;/tools> XML tags:\n&lt;tools>&quot; }}&#10; {%- for tool in tools %}&#10; {{- &quot;\n&quot; }}&#10; {{- tool | tojson }}&#10; {%- endfor %}&#10; {{- &quot;\n&lt;/tools>\n\nFor each function call, return a json object with function name and arguments within &lt;tool_call>&lt;/tool_call> XML tags:\n&lt;tool_call>\n{\&quot;name\&quot;: &lt;function-name>, \&quot;arguments\&quot;: &lt;args-json-object>}\n&lt;/tool_call>&lt;|im_end|>\n&quot; }}&#10;{%- else %}&#10; {%- if messages[0]['role'] == 'system' %}&#10; {{- '&lt;|im_start|>system\n' + messages[0]['content'] + '&lt;|im_end|>\n' }}&#10; {%- else %}&#10; {{- '&lt;|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.&lt;|im_end|>\n' }}&#10; {%- endif %}&#10;{%- endif %}&#10;{%- for message in messages %}&#10; {%- if (message.role == &quot;user&quot;) or (message.role == &quot;system&quot; and not loop.first) or (message.role == &quot;assistant&quot; and not message.tool_calls) %}&#10; {{- '&lt;|im_start|>' + message.role + '\n' + message.content + '&lt;|im_end|>' + '\n' }}&#10; {%- elif message.role == &quot;assistant&quot; %}&#10; {{- '&lt;|im_start|>' + message.role }}&#10; {%- if message.content %}&#10; {{- '\n' + message.content }}&#10; {%- endif %}&#10; {%- for tool_call in message.tool_calls %}&#10; {%- if tool_call.function is defined %}&#10; {%- set tool_call = tool_call.function %}&#10; {%- endif %}&#10; {{- '\n&lt;tool_call>\n{&quot;name&quot;: &quot;' }}&#10; {{- tool_call.name }}&#10; {{- '&quot;, &quot;arguments&quot;: ' }}&#10; {{- tool_call.arguments | tojson }}&#10; {{- '}\n&lt;/tool_call>' }}&#10; {%- endfor %}&#10; {{- '&lt;|im_end|>\n' }}&#10; {%- elif message.role == &quot;tool&quot; %}&#10; {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != &quot;tool&quot;) %}&#10; {{- '&lt;|im_start|>user' }}&#10; {%- endif %}&#10; {{- '\n&lt;tool_response>\n' }}&#10; {{- message.content }}&#10; {{- '\n&lt;/tool_response>' }}&#10; {%- if loop.last or (messages[loop.index0 + 1].role != &quot;tool&quot;) %}&#10; {{- '&lt;|im_end|>\n' }}&#10; {%- endif %}&#10; {%- endif %}&#10;{%- endfor %}&#10;{%- if add_generation_prompt %}&#10; {{- '&lt;|im_start|>assistant\n' }}&#10;{%- endif %}&#10;" />
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="2024.5.0.0.dev20241030" />
168
+ <openvino_version value="2024.5.0.dev20241030" />
169
+ <original_tokenizer_class value="&lt;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>