fix: add __type to token dicts, add tokenizer_class, fix Configuration Parsing Warning

#2
by King3Djbl - opened
Files changed (1) hide show
  1. tokenizer_config.json +37 -199
tokenizer_config.json CHANGED
@@ -1,203 +1,41 @@
1
  {
 
 
2
  "add_prefix_space": false,
3
- "backend": "tokenizers",
4
- "bos_token": null,
5
- "clean_up_tokenization_spaces": false,
6
- "eos_token": "<|im_end|>",
7
- "errors": "replace",
8
- "extra_special_tokens": [],
9
- "is_local": false,
10
- "model_max_length": 32768,
11
- "pad_token": "<|PAD_TOKEN|>",
12
- "padding_side": "right",
13
- "split_special_tokens": false,
14
- "tokenizer_class": "Qwen2Tokenizer",
15
- "unk_token": null,
16
- "added_tokens_decoder": {
17
- "151643": {
18
- "content": "<|endoftext|>",
19
- "single_word": false,
20
- "lstrip": false,
21
- "rstrip": false,
22
- "normalized": false,
23
- "special": true
24
- },
25
- "151644": {
26
- "content": "<|im_start|>",
27
- "single_word": false,
28
- "lstrip": false,
29
- "rstrip": false,
30
- "normalized": false,
31
- "special": true
32
- },
33
- "151645": {
34
- "content": "<|im_end|>",
35
- "single_word": false,
36
- "lstrip": false,
37
- "rstrip": false,
38
- "normalized": false,
39
- "special": true
40
- },
41
- "151646": {
42
- "content": "<|object_ref_start|>",
43
- "single_word": false,
44
- "lstrip": false,
45
- "rstrip": false,
46
- "normalized": false,
47
- "special": true
48
- },
49
- "151647": {
50
- "content": "<|object_ref_end|>",
51
- "single_word": false,
52
- "lstrip": false,
53
- "rstrip": false,
54
- "normalized": false,
55
- "special": true
56
- },
57
- "151648": {
58
- "content": "<|box_start|>",
59
- "single_word": false,
60
- "lstrip": false,
61
- "rstrip": false,
62
- "normalized": false,
63
- "special": true
64
- },
65
- "151649": {
66
- "content": "<|box_end|>",
67
- "single_word": false,
68
- "lstrip": false,
69
- "rstrip": false,
70
- "normalized": false,
71
- "special": true
72
- },
73
- "151650": {
74
- "content": "<|quad_start|>",
75
- "single_word": false,
76
- "lstrip": false,
77
- "rstrip": false,
78
- "normalized": false,
79
- "special": true
80
- },
81
- "151651": {
82
- "content": "<|quad_end|>",
83
- "single_word": false,
84
- "lstrip": false,
85
- "rstrip": false,
86
- "normalized": false,
87
- "special": true
88
- },
89
- "151652": {
90
- "content": "<|vision_start|>",
91
- "single_word": false,
92
- "lstrip": false,
93
- "rstrip": false,
94
- "normalized": false,
95
- "special": true
96
- },
97
- "151653": {
98
- "content": "<|vision_end|>",
99
- "single_word": false,
100
- "lstrip": false,
101
- "rstrip": false,
102
- "normalized": false,
103
- "special": true
104
- },
105
- "151654": {
106
- "content": "<|vision_pad|>",
107
- "single_word": false,
108
- "lstrip": false,
109
- "rstrip": false,
110
- "normalized": false,
111
- "special": true
112
- },
113
- "151655": {
114
- "content": "<|image_pad|>",
115
- "single_word": false,
116
- "lstrip": false,
117
- "rstrip": false,
118
- "normalized": false,
119
- "special": true
120
- },
121
- "151656": {
122
- "content": "<|video_pad|>",
123
- "single_word": false,
124
- "lstrip": false,
125
- "rstrip": false,
126
- "normalized": false,
127
- "special": true
128
- },
129
- "151657": {
130
- "content": "<tool_call>",
131
- "single_word": false,
132
- "lstrip": false,
133
- "rstrip": false,
134
- "normalized": false,
135
- "special": false
136
- },
137
- "151658": {
138
- "content": "</tool_call>",
139
- "single_word": false,
140
- "lstrip": false,
141
- "rstrip": false,
142
- "normalized": false,
143
- "special": false
144
- },
145
- "151659": {
146
- "content": "<|fim_prefix|>",
147
- "single_word": false,
148
- "lstrip": false,
149
- "rstrip": false,
150
- "normalized": false,
151
- "special": false
152
- },
153
- "151660": {
154
- "content": "<|fim_middle|>",
155
- "single_word": false,
156
- "lstrip": false,
157
- "rstrip": false,
158
- "normalized": false,
159
- "special": false
160
- },
161
- "151661": {
162
- "content": "<|fim_suffix|>",
163
- "single_word": false,
164
- "lstrip": false,
165
- "rstrip": false,
166
- "normalized": false,
167
- "special": false
168
- },
169
- "151662": {
170
- "content": "<|fim_pad|>",
171
- "single_word": false,
172
- "lstrip": false,
173
- "rstrip": false,
174
- "normalized": false,
175
- "special": false
176
- },
177
- "151663": {
178
- "content": "<|repo_name|>",
179
- "single_word": false,
180
- "lstrip": false,
181
- "rstrip": false,
182
- "normalized": false,
183
- "special": false
184
- },
185
- "151664": {
186
- "content": "<|file_sep|>",
187
- "single_word": false,
188
- "lstrip": false,
189
- "rstrip": false,
190
- "normalized": false,
191
- "special": false
192
- },
193
- "151665": {
194
- "content": "<|PAD_TOKEN|>",
195
- "single_word": false,
196
- "lstrip": false,
197
- "rstrip": false,
198
- "normalized": false,
199
- "special": true
200
- }
201
  },
202
- "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\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>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\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\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\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{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
 
1
  {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
  "add_prefix_space": false,
5
+ "bos_token": {
6
+ "content": "<s>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "__type": "AddedToken"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  },
13
+ "eos_token": {
14
+ "content": "</s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "__type": "AddedToken"
20
+ },
21
+ "unk_token": {
22
+ "content": "<unk>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "__type": "AddedToken"
28
+ },
29
+ "pad_token": {
30
+ "content": "<pad>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "__type": "AddedToken"
36
+ },
37
+ "model_type": "llama",
38
+ "model_max_length": 2048,
39
+ "tokenizer_class": "PreTrainedTokenizerFast",
40
+ "clean_up_tokenization_spaces": false
41
  }