bwshen-mi commited on
Commit
c7cc03e
·
verified ·
1 Parent(s): 7f97874

Upload 5 files

Browse files
audio_tokenizer/chat_template.jinja ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {%- if messages[0].content is string %}
5
+ {{- messages[0].content }}
6
+ {%- else %}
7
+ {%- for content in messages[0].content %}
8
+ {%- if content.type == 'audio' %}
9
+ {{- ("<|sosp|>" + (content.meta | tojson) + "<|eosp|>") }}
10
+ {%- elif content.type == 'text' %}
11
+ {{- content.text }}
12
+ {%- endif %}
13
+ {%- endfor %}
14
+ {%- endif %}
15
+ {%- endif %}
16
+ {{- '\n\n' }}
17
+ {{- "# 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>" }}
18
+ {%- for tool in tools %}
19
+ {{- "\n" }}
20
+ {{- tool | tojson }}
21
+ {%- endfor %}
22
+ {{- "\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" }}
23
+ {%- else %}
24
+ {%- if messages[0].role == 'system' %}
25
+ {{- '<|im_start|>system\n' }}
26
+ {%- if messages[0].content is string %}
27
+ {{- messages[0].content }}
28
+ {%- else %}
29
+ {%- for content in messages[0].content %}
30
+ {%- if content.type == 'audio' %}
31
+ {{- ("<|sosp|>" + (content.meta | tojson) + "<|eosp|>") }}
32
+ {%- elif content.type == 'text' %}
33
+ {{- content.text }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- endif %}
37
+ {{- '\n<|im_end|>\n' }}
38
+ {%- endif %}
39
+ {%- endif %}
40
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1, assistant_is_last=false) %}
41
+ {%- for message in messages[::-1] %}
42
+ {%- set index = (messages|length - 1) - loop.index0 %}
43
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
44
+ {%- set ns.multi_step_tool = false %}
45
+ {%- set ns.last_query_index = index %}
46
+ {%- endif %}
47
+ {%- endfor %}
48
+ {%- for message in messages %}
49
+ {%- if message.content is string %}
50
+ {%- set content = message.content %}
51
+ {%- else %}
52
+ {%- set content = namespace(text="") %}
53
+ {%- for mcontent in message.content %}
54
+ {%- if mcontent.type == 'audio' %}
55
+ {%- set content.text = content.text~("<|sosp|>" + (mcontent.meta | tojson) + "<|eosp|>") %}
56
+ {%- elif mcontent.type == 'text' %}
57
+ {%- set content.text = content.text~mcontent.text %}
58
+ {%- endif %}
59
+ {%- endfor %}
60
+ {%- set content = content.text %}
61
+ {%- endif %}
62
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
63
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
64
+ {%- elif message.role == "assistant" %}
65
+ {%- set reasoning_content = "" %}
66
+ {%- if message.reasoning_content is string %}
67
+ {%- set reasoning_content = message.reasoning_content %}
68
+ {%- else %}
69
+ {%- if '</think>' in content %}
70
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
71
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
72
+ {%- endif %}
73
+ {%- endif %}
74
+ {%- if loop.index0 > ns.last_query_index %}
75
+ {%- if loop.last or (not loop.last and reasoning_content) %}
76
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip("\n") + '\n</think>\n\n' + content.lstrip('\n') }}
77
+ {%- else %}
78
+ {{- '<|im_start|>' + message.role + '\n' + content }}
79
+ {%- endif %}
80
+ {%- else %}
81
+ {{- '<|im_start|>' + message.role + '\n' + content }}
82
+ {%- endif %}
83
+ {%- if message.tool_calls %}
84
+ {%- for tool_call in message.tool_calls %}
85
+ {%- if (loop.first and content) or (not loop.first) %}{{- '\n' }}{%- endif %}
86
+ {%- if tool_call.function %}
87
+ {%- set tool_call = tool_call.function %}
88
+ {%- endif %}
89
+ {{- '<tool_call>\n{"name": "' }}
90
+ {{- tool_call.name }}
91
+ {{- '", "arguments": ' }}
92
+ {%- if tool_call.arguments is string %}
93
+ {{- tool_call.arguments }}
94
+ {%- else %}
95
+ {{- tool_call.arguments | tojson }}
96
+ {%- endif %}
97
+ {{- '}\n</tool_call>' }}
98
+ {%- endfor %}
99
+ {%- endif %}
100
+ {%- if loop.last %}
101
+ {%- set ns.assistant_is_last = true %}
102
+ {%- else %}
103
+ {{- '<|im_end|>\n' }}
104
+ {%- endif %}
105
+ {%- elif message.role == "tool" %}
106
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}{{- '<|im_start|>user' }}{%- endif %}
107
+ {{- '\n<tool_response>\n' }}
108
+ {{- content }}
109
+ {{- '\n</tool_response>' }}
110
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}{{- '<|im_end|>\n' }}{%- endif %}
111
+ {%- endif %}
112
+ {%- endfor %}
113
+ {%- if add_generation_prompt and not ns.assistant_is_last %}
114
+ {{- '<|im_start|>assistant\n' }}
115
+ {%- if audio_output %}
116
+ {{- '<|sostm|>'}}
117
+ {%- elif not enable_thinking %}
118
+ {{- '<think>\n\n</think>\n' }}
119
+ {%- endif %}
120
+ {%- endif %}
audio_tokenizer/config.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "max_audio_seconds": 300,
3
+ "stride_size": 2,
4
+ "avg_pooler": 2,
5
+ "d_model": 1024,
6
+ "scale_embedding": false,
7
+ "kernel_size": 3,
8
+ "activation_function": "gelu",
9
+ "encoder_layers": 24,
10
+ "encoder_skip_layer_id": 3,
11
+ "encoder_attention_heads": 16,
12
+ "encoder_ffn_dim": 4096,
13
+ "encoder_causal": true,
14
+ "encoder_attn_window_size": [
15
+ 128,
16
+ 0
17
+ ],
18
+ "decoder_layers": 24,
19
+ "decoder_attention_heads": 16,
20
+ "decoder_ffn_dim": 4096,
21
+ "decoder_kernel_size": 3,
22
+ "decoder_stride_size": 2,
23
+ "decoder_causal": true,
24
+ "decoder_attn_window_size": [
25
+ 128,
26
+ 0
27
+ ],
28
+ "nfft": 960,
29
+ "n_mels": 128,
30
+ "sampling_rate": 24000,
31
+ "hop_length": 240,
32
+ "window_size": 960,
33
+ "vocoder_padding": "same",
34
+ "fmin": 0,
35
+ "fmax": null,
36
+ "num_quantizers": 20,
37
+ "codebook_size": [
38
+ 1024,
39
+ 1024,
40
+ 256,
41
+ 128,
42
+ 128,
43
+ 128,
44
+ 128,
45
+ 128,
46
+ 128,
47
+ 128,
48
+ 128,
49
+ 128,
50
+ 128,
51
+ 128,
52
+ 128,
53
+ 128,
54
+ 128,
55
+ 128,
56
+ 128,
57
+ 128
58
+ ],
59
+ "threshold_ema_dead_code": 2,
60
+ "position_embedding_type": "rope",
61
+ "rope_theta": 10000,
62
+ "rope_type": "default",
63
+ "ln_type": "LayerNorm",
64
+ "use_istft_only": true,
65
+ "hybrid_attention": true,
66
+ "hybrid_block_size": 8,
67
+ "swa_per_block": 2
68
+ }
audio_tokenizer/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_sample": true,
3
+ "temperature": 0.6,
4
+ "top_k": -1,
5
+ "top_p": 0.95,
6
+ "audio_temperature": 0.9,
7
+ "audio_top_k": -1,
8
+ "audio_top_p": 0.95
9
+ }
audio_tokenizer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95cca046bda0a67ea52cc77af734ed175282820efbc508099dd8a012eb968cea
3
+ size 652622472
audio_tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<|mimo_audio_start|>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ },
189
+ "151666": {
190
+ "content": "<|mimo_audio_end|>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": true
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ },
213
+ "151669": {
214
+ "content": "<|audio_pad|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "151670": {
222
+ "content": "<|mimo_video_start|>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "151671": {
230
+ "content": "<|mimo_video_end|>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ }
237
+ },
238
+ "additional_special_tokens": [
239
+ "<|im_start|>",
240
+ "<|im_end|>",
241
+ "<|object_ref_start|>",
242
+ "<|object_ref_end|>",
243
+ "<|box_start|>",
244
+ "<|box_end|>",
245
+ "<|quad_start|>",
246
+ "<|quad_end|>",
247
+ "<|vision_start|>",
248
+ "<|vision_end|>",
249
+ "<|vision_pad|>",
250
+ "<|image_pad|>",
251
+ "<|video_pad|>",
252
+ "<|audio_pad|>",
253
+ "<|mimo_audio_start|>",
254
+ "<|mimo_audio_end|>",
255
+ "<|mimo_video_start|>",
256
+ "<|mimo_video_end|>"
257
+ ],
258
+ "bos_token": null,
259
+ "clean_up_tokenization_spaces": false,
260
+ "eos_token": "<|im_end|>",
261
+ "errors": "replace",
262
+ "model_max_length": 131072,
263
+ "pad_token": "<|endoftext|>",
264
+ "split_special_tokens": false,
265
+ "tokenizer_class": "Qwen2Tokenizer",
266
+ "unk_token": null
267
+ }