Reza2kn commited on
Commit
cead59c
·
verified ·
1 Parent(s): 34d7e53

Initial upload: INT4 ONNX (encoder + prefill + step) + tokenizer + examples + inference.py

Browse files
.gitattributes CHANGED
@@ -33,3 +33,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ examples/distortion.wav filter=lfs diff=lfs merge=lfs -text
37
+ examples/dropout.wav filter=lfs diff=lfs merge=lfs -text
38
+ examples/echo.wav filter=lfs diff=lfs merge=lfs -text
39
+ examples/far_field.wav filter=lfs diff=lfs merge=lfs -text
40
+ examples/mixed.wav filter=lfs diff=lfs merge=lfs -text
41
+ examples/noise.wav filter=lfs diff=lfs merge=lfs -text
42
+ examples/obstructed.wav filter=lfs diff=lfs merge=lfs -text
43
+ examples/recording.wav filter=lfs diff=lfs merge=lfs -text
44
+ onnx/audio_encoder_int4.onnx.data filter=lfs diff=lfs merge=lfs -text
45
+ onnx/decoder_prefill_int4.onnx.data filter=lfs diff=lfs merge=lfs -text
46
+ onnx/decoder_step_int4.onnx.data filter=lfs diff=lfs merge=lfs -text
chat_template.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"chat_template": "{%- set ns = namespace(system_text=\"\") -%}\n{%- for m in messages -%}\n {%- if m.role == 'system' -%}\n {%- if m.content is string -%}\n {%- set ns.system_text = ns.system_text + m.content -%}\n {%- else -%}\n {%- for c in m.content -%}\n {%- if c.type == 'text' and (c.text is defined) -%}\n {%- set ns.system_text = ns.system_text + c.text -%}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n\n{%- set ns2 = namespace(audio_tokens=\"\") -%}\n{%- for m in messages -%}\n {%- if m.content is not string -%}\n {%- for c in m.content -%}\n {%- if c.type == 'audio' or ('audio' in c) or ('audio_url' in c) -%}\n {%- set ns2.audio_tokens = ns2.audio_tokens + \"<|audio_start|><|audio_pad|><|audio_end|>\" -%}\n {%- endif -%}\n {%- endfor -%}\n {%- endif -%}\n{%- endfor -%}\n\n{{- '<|im_start|>system\\n' + (ns.system_text if ns.system_text is string else '') + '<|im_end|>\\n' -}}\n{{- '<|im_start|>user\\n' + ns2.audio_tokens + '<|im_end|>\\n' -}}\n{%- if add_generation_prompt -%}\n{{- '<|im_start|>assistant\\n' -}}\n{%- endif -%}"}
config.json ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ASRForConditionalGeneration"
4
+ ],
5
+ "model_type": "qwen3_asr",
6
+ "support_languages": [
7
+ "Chinese",
8
+ "English",
9
+ "Cantonese",
10
+ "Arabic",
11
+ "German",
12
+ "French",
13
+ "Spanish",
14
+ "Portuguese",
15
+ "Indonesian",
16
+ "Italian",
17
+ "Korean",
18
+ "Russian",
19
+ "Thai",
20
+ "Vietnamese",
21
+ "Japanese",
22
+ "Turkish",
23
+ "Hindi",
24
+ "Malay",
25
+ "Dutch",
26
+ "Swedish",
27
+ "Danish",
28
+ "Finnish",
29
+ "Polish",
30
+ "Czech",
31
+ "Filipino",
32
+ "Persian",
33
+ "Greek",
34
+ "Romanian",
35
+ "Hungarian",
36
+ "Macedonian"
37
+ ],
38
+ "thinker_config": {
39
+ "model_type": "qwen3_asr",
40
+ "architectures": [
41
+ "Qwen3ASRForConditionalGeneration"
42
+ ],
43
+ "audio_config": {
44
+ "_name_or_path": "",
45
+ "activation_dropout": 0,
46
+ "activation_function": "gelu",
47
+ "add_cross_attention": false,
48
+ "architectures": null,
49
+ "attention_dropout": 0,
50
+ "bad_words_ids": null,
51
+ "begin_suppress_tokens": null,
52
+ "bos_token_id": null,
53
+ "chunk_size_feed_forward": 0,
54
+ "conv_chunksize": 500,
55
+ "cross_attention_hidden_size": null,
56
+ "d_model": 1024,
57
+ "decoder_start_token_id": null,
58
+ "diversity_penalty": 0.0,
59
+ "do_sample": false,
60
+ "downsample_hidden_size": 480,
61
+ "dropout": 0,
62
+ "dtype": null,
63
+ "early_stopping": false,
64
+ "encoder_attention_heads": 16,
65
+ "encoder_ffn_dim": 4096,
66
+ "encoder_layers": 24,
67
+ "encoder_no_repeat_ngram_size": 0,
68
+ "eos_token_id": null,
69
+ "exponential_decay_length_penalty": null,
70
+ "finetuning_task": null,
71
+ "forced_bos_token_id": null,
72
+ "forced_eos_token_id": null,
73
+ "id2label": {
74
+ "0": "LABEL_0",
75
+ "1": "LABEL_1"
76
+ },
77
+ "initializer_range": 0.02,
78
+ "is_decoder": false,
79
+ "is_encoder_decoder": false,
80
+ "label2id": {
81
+ "LABEL_0": 0,
82
+ "LABEL_1": 1
83
+ },
84
+ "length_penalty": 1.0,
85
+ "max_length": 20,
86
+ "max_source_positions": 1500,
87
+ "min_length": 0,
88
+ "model_type": "qwen3_asr_audio_encoder",
89
+ "n_window": 50,
90
+ "n_window_infer": 800,
91
+ "no_repeat_ngram_size": 0,
92
+ "num_beam_groups": 1,
93
+ "num_beams": 1,
94
+ "num_hidden_layers": 24,
95
+ "num_mel_bins": 128,
96
+ "num_return_sequences": 1,
97
+ "output_attentions": false,
98
+ "output_dim": 2048,
99
+ "output_hidden_states": false,
100
+ "output_scores": false,
101
+ "pad_token_id": null,
102
+ "prefix": null,
103
+ "problem_type": null,
104
+ "pruned_heads": {},
105
+ "remove_invalid_values": false,
106
+ "repetition_penalty": 1.0,
107
+ "return_dict": true,
108
+ "return_dict_in_generate": false,
109
+ "scale_embedding": false,
110
+ "sep_token_id": null,
111
+ "suppress_tokens": null,
112
+ "task_specific_params": null,
113
+ "temperature": 1.0,
114
+ "tf_legacy_loss": false,
115
+ "tie_encoder_decoder": false,
116
+ "tie_word_embeddings": true,
117
+ "tokenizer_class": null,
118
+ "top_k": 50,
119
+ "top_p": 1.0,
120
+ "torchscript": false,
121
+ "typical_p": 1.0,
122
+ "use_bfloat16": false
123
+ },
124
+ "audio_end_token_id": 151670,
125
+ "audio_start_token_id": 151669,
126
+ "audio_token_id": 151676,
127
+ "dtype": "bfloat16",
128
+ "initializer_range": 0.02,
129
+ "text_config": {
130
+ "_name_or_path": "",
131
+ "add_cross_attention": false,
132
+ "architectures": null,
133
+ "attention_bias": false,
134
+ "attention_dropout": 0.0,
135
+ "bad_words_ids": null,
136
+ "begin_suppress_tokens": null,
137
+ "bos_token_id": null,
138
+ "chunk_size_feed_forward": 0,
139
+ "cross_attention_hidden_size": null,
140
+ "decoder_start_token_id": null,
141
+ "diversity_penalty": 0.0,
142
+ "do_sample": false,
143
+ "dtype": null,
144
+ "early_stopping": false,
145
+ "encoder_no_repeat_ngram_size": 0,
146
+ "eos_token_id": null,
147
+ "exponential_decay_length_penalty": null,
148
+ "finetuning_task": null,
149
+ "forced_bos_token_id": null,
150
+ "forced_eos_token_id": null,
151
+ "head_dim": 128,
152
+ "hidden_act": "silu",
153
+ "hidden_size": 2048,
154
+ "id2label": {
155
+ "0": "LABEL_0",
156
+ "1": "LABEL_1"
157
+ },
158
+ "initializer_range": 0.02,
159
+ "intermediate_size": 6144,
160
+ "is_decoder": false,
161
+ "is_encoder_decoder": false,
162
+ "label2id": {
163
+ "LABEL_0": 0,
164
+ "LABEL_1": 1
165
+ },
166
+ "length_penalty": 1.0,
167
+ "max_length": 20,
168
+ "max_position_embeddings": 65536,
169
+ "min_length": 0,
170
+ "model_type": "qwen3",
171
+ "no_repeat_ngram_size": 0,
172
+ "num_attention_heads": 16,
173
+ "num_beam_groups": 1,
174
+ "num_beams": 1,
175
+ "num_hidden_layers": 28,
176
+ "num_key_value_heads": 8,
177
+ "num_return_sequences": 1,
178
+ "output_attentions": false,
179
+ "output_hidden_states": false,
180
+ "output_scores": false,
181
+ "pad_token_id": null,
182
+ "prefix": null,
183
+ "problem_type": null,
184
+ "pruned_heads": {},
185
+ "remove_invalid_values": false,
186
+ "repetition_penalty": 1.0,
187
+ "return_dict": true,
188
+ "return_dict_in_generate": false,
189
+ "rms_norm_eps": 1e-06,
190
+ "rope_scaling": {
191
+ "interleaved": true,
192
+ "mrope_interleaved": true,
193
+ "mrope_section": [
194
+ 24,
195
+ 20,
196
+ 20
197
+ ],
198
+ "rope_type": "default",
199
+ "type": "default"
200
+ },
201
+ "rope_theta": 1000000,
202
+ "sep_token_id": null,
203
+ "suppress_tokens": null,
204
+ "task_specific_params": null,
205
+ "temperature": 1.0,
206
+ "tf_legacy_loss": false,
207
+ "tie_encoder_decoder": false,
208
+ "tie_word_embeddings": true,
209
+ "tokenizer_class": null,
210
+ "top_k": 50,
211
+ "top_p": 1.0,
212
+ "torchscript": false,
213
+ "typical_p": 1.0,
214
+ "use_bfloat16": false,
215
+ "use_cache": true,
216
+ "vocab_size": 151936
217
+ }
218
+ },
219
+ "transformers_version": "4.57.6"
220
+ }
221
+
examples/distortion.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:194231a8aa2a31049d167df3f52bc62d4e9377aa935678c983d1165f3c9ca86d
3
+ size 353324
examples/dropout.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff94831ee3497ce90d9b873719b823e5c4c4a9890dec86832e0b6357cd2b2e6f
3
+ size 320684
examples/echo.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2eda219a3b7091c7a2772408db3f0356d1d7d30184d0523a6c98f6fdec35bd2b
3
+ size 359084
examples/far_field.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4546478ee704b5b7b81bb4937e6c74b48be82aef541e0fb3388fcb49789082d
3
+ size 284204
examples/mixed.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:339b28e7f59abb2dcfac81c22298060a5da85d09ea3363a8e4004e17a15b31e2
3
+ size 243884
examples/noise.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96793b49e286c7b05a3081fccf0d6a6f7df85cc5aef0a2d28f3b4aaba60d95d1
3
+ size 416684
examples/obstructed.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:411e605c25a6a8a6b09e49f0db2ad7543854bbcd0cab4cd7157fc429f9c5b0d3
3
+ size 422444
examples/recording.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a548239681d613a007375825fd2423494be634c49bd450e46743f29101ffdcfc
3
+ size 240044
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": [
4
+ 151643,
5
+ 151645
6
+ ],
7
+ "pad_token_id": 151643,
8
+ "do_sample": false
9
+ }
inference.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Standalone Mega-ASR inference using the INT4 ONNX models.
2
+
3
+ This script demonstrates how to run Mega-ASR end-to-end from raw audio
4
+ using only the ONNX models in this repo plus the qwen-asr tokenizer.
5
+
6
+ Requirements:
7
+ pip install onnxruntime numpy soundfile transformers qwen-asr
8
+
9
+ Usage:
10
+ python inference.py --audio examples/noise.wav
11
+ """
12
+ from __future__ import annotations
13
+
14
+ import argparse
15
+ import re
16
+ import sys
17
+ from pathlib import Path
18
+
19
+ import numpy as np
20
+ import onnxruntime as ort
21
+ import soundfile as sf
22
+
23
+
24
+ HERE = Path(__file__).parent
25
+
26
+
27
+ def _ort(path, providers=("CPUExecutionProvider",)):
28
+ so = ort.SessionOptions()
29
+ so.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_ALL
30
+ return ort.InferenceSession(str(path), so, providers=list(providers))
31
+
32
+
33
+ def main() -> int:
34
+ ap = argparse.ArgumentParser()
35
+ ap.add_argument("--audio", required=True, type=Path)
36
+ ap.add_argument("--max-new-tokens", type=int, default=80)
37
+ ap.add_argument("--providers", default="cuda,cpu",
38
+ help="Comma-separated ORT providers, e.g. cuda,cpu")
39
+ args = ap.parse_args()
40
+
41
+ providers = []
42
+ for p in args.providers.split(","):
43
+ p = p.strip().lower()
44
+ if p == "cuda": providers.append("CUDAExecutionProvider")
45
+ elif p == "cpu": providers.append("CPUExecutionProvider")
46
+ elif p == "webgpu": providers.append("WebGpuExecutionProvider")
47
+
48
+ # 1) Tokenizer + processor (needs HF transformers + qwen-asr installed)
49
+ from transformers import AutoTokenizer
50
+ from qwen_asr.core.transformers_backend.processing_qwen3_asr import Qwen3ASRProcessor
51
+ tokenizer = AutoTokenizer.from_pretrained(str(HERE))
52
+ processor = Qwen3ASRProcessor.from_pretrained(str(HERE))
53
+
54
+ # 2) Read audio + build mel features
55
+ audio, sr = sf.read(str(args.audio))
56
+ if sr != 16000:
57
+ import librosa
58
+ audio = librosa.resample(audio.astype(np.float32), orig_sr=sr, target_sr=16000)
59
+
60
+ # The processor expects a prompt with the audio placeholder. Build it as
61
+ # the Qwen3-ASR chat template would.
62
+ prompt = (
63
+ "<|im_start|>system\\nYou are a speech recognition model.<|im_end|>\\n"
64
+ "<|im_start|>user\\nDetect the language and recognize the speech: "
65
+ "<|audio_start|><|audio_pad|><|audio_end|><|im_end|>\\n"
66
+ "<|im_start|>assistant\\n"
67
+ )
68
+ inputs = processor(text=[prompt], audio=[audio], return_tensors="np", padding=True)
69
+ text_ids = inputs["input_ids"] # (1, L)
70
+ attention_mask = inputs["attention_mask"] # (1, L)
71
+ input_features = inputs["input_features"] # (1, 128, T_mel)
72
+
73
+ # 3) Audio encoder
74
+ T_mel = input_features.shape[-1]
75
+ if T_mel > 3000:
76
+ input_features = input_features[..., :3000]
77
+ T_mel = 3000
78
+ mel_padded = np.pad(input_features.astype(np.float32),
79
+ ((0, 0), (0, 0), (0, 3000 - T_mel)))
80
+ enc = _ort(HERE / "onnx" / "audio_encoder_int4.onnx", providers)
81
+ audio_embeds = enc.run(["audio_embeds"], {"mel": mel_padded})[0] # (1, 390, 2048)
82
+ real_chunks = (T_mel + 99) // 100
83
+ last_chunk_mel = T_mel - (real_chunks - 1) * 100
84
+ real_audio_frames = (real_chunks - 1) * 13 + (last_chunk_mel + 7) // 8
85
+ audio_embeds = audio_embeds[:, :real_audio_frames] # (1, N, 2048)
86
+
87
+ # 4) Embed text tokens + scatter audio into placeholder positions
88
+ # The embedding table is published as embed_tokens.npy in the repo
89
+ # (extracted from the original Qwen3-ASR weights for portability).
90
+ embed_path = HERE / "onnx" / "embed_tokens.npy"
91
+ if embed_path.exists():
92
+ embed_w = np.load(embed_path).astype(np.float16)
93
+ else:
94
+ raise FileNotFoundError(
95
+ "embed_tokens.npy missing — re-extract from the source PT model."
96
+ )
97
+ inputs_embeds = embed_w[text_ids[0]][None] # (1, L, hidden)
98
+ audio_token_id = tokenizer.convert_tokens_to_ids("<|audio_pad|>")
99
+ placeholder_mask = (text_ids == audio_token_id) # (1, L)
100
+ # Replace placeholder embeddings with audio_embeds[0] in order
101
+ placeholder_idx = np.where(placeholder_mask[0])[0]
102
+ n_replace = min(len(placeholder_idx), audio_embeds.shape[1])
103
+ inputs_embeds[0, placeholder_idx[:n_replace]] = audio_embeds[0, :n_replace]
104
+
105
+ # 5) Position ids (1D)
106
+ pos_ids = np.arange(text_ids.shape[1])[None].astype(np.int64)
107
+
108
+ # 6) Prefill ONNX
109
+ prefill = _ort(HERE / "onnx" / "decoder_prefill_int4.onnx", providers)
110
+ feeds = {
111
+ "inputs_embeds": inputs_embeds.astype(np.float16),
112
+ "attention_mask": attention_mask.astype(np.int64),
113
+ "position_ids": pos_ids,
114
+ }
115
+ out = prefill.run(None, feeds)
116
+ logits, *past_kvs = out
117
+ eos = tokenizer.eos_token_id
118
+
119
+ # 7) Greedy decode with step ONNX
120
+ step = _ort(HERE / "onnx" / "decoder_step_int4.onnx", providers)
121
+ num_layers = 28
122
+ cur_len = inputs_embeds.shape[1]
123
+ gen = []
124
+ nid = int(np.argmax(logits[0, -1, :]))
125
+ gen.append(nid)
126
+
127
+ for _ in range(args.max_new_tokens - 1):
128
+ if nid == eos: break
129
+ new_embed = embed_w[nid][None, None].astype(np.float16)
130
+ new_attn = np.ones((1, cur_len + 1), dtype=np.int64)
131
+ new_pos = np.array([[cur_len]], dtype=np.int64)
132
+ f = {"inputs_embeds": new_embed,
133
+ "attention_mask": new_attn,
134
+ "position_ids": new_pos}
135
+ for i in range(num_layers):
136
+ f[f"past.{i}.key"] = past_kvs[2 * i]
137
+ f[f"past.{i}.value"] = past_kvs[2 * i + 1]
138
+ out = step.run(None, f)
139
+ logits, *past_kvs = out
140
+ nid = int(np.argmax(logits[0, -1, :]))
141
+ gen.append(nid)
142
+ cur_len += 1
143
+
144
+ text = tokenizer.decode(gen, skip_special_tokens=True, clean_up_tokenization_spaces=False)
145
+ print(f"TRANSCRIPTION: {text}")
146
+ return 0
147
+
148
+
149
+ if __name__ == "__main__":
150
+ sys.exit(main())
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
onnx/audio_encoder_int4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d5794e7ba5a96c836a0377d4fdd767ee1f1224b3958bd3b8077b1f618efab0b7
3
+ size 202471
onnx/audio_encoder_int4.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e77f76d9ecc1bf83ff8625e7752b8b48f1b2ec2850aecf441be20e53e2f99515
3
+ size 213590040
onnx/decoder_prefill_int4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f9a614c02a60675cc484dc821b931ae2caa25468c0b4fec9b254d8fb0956972
3
+ size 4693422
onnx/decoder_prefill_int4.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b50e23cd84e89c89e14fc78867beb3305247231b1716e515e1d2655d41ce03
3
+ size 967987200
onnx/decoder_step_int4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a50be8689ce3d03c1087432012411804e77829ded5c24b03f662dc11ee8569bb
3
+ size 4672657
onnx/decoder_step_int4.onnx.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b50e23cd84e89c89e14fc78867beb3305247231b1716e515e1d2655d41ce03
3
+ size 967987200
preprocessor_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "chunk_length": 30,
3
+ "dither": 0.0,
4
+ "feature_extractor_type": "WhisperFeatureExtractor",
5
+ "feature_size": 128,
6
+ "hop_length": 160,
7
+ "n_fft": 400,
8
+ "n_samples": 480000,
9
+ "nb_max_frames": 3000,
10
+ "padding_side": "right",
11
+ "padding_value": 0.0,
12
+ "processor_class": "Qwen3ASRProcessor",
13
+ "return_attention_mask": true
14
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,549 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
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_start|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "151670": {
222
+ "content": "<|audio_end|>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "151671": {
230
+ "content": "<tts_pad>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ },
237
+ "151672": {
238
+ "content": "<tts_text_bos>",
239
+ "lstrip": false,
240
+ "normalized": false,
241
+ "rstrip": false,
242
+ "single_word": false,
243
+ "special": true
244
+ },
245
+ "151673": {
246
+ "content": "<tts_text_eod>",
247
+ "lstrip": false,
248
+ "normalized": false,
249
+ "rstrip": false,
250
+ "single_word": false,
251
+ "special": true
252
+ },
253
+ "151674": {
254
+ "content": "<tts_text_bos_single>",
255
+ "lstrip": false,
256
+ "normalized": false,
257
+ "rstrip": false,
258
+ "single_word": false,
259
+ "special": true
260
+ },
261
+ "151675": {
262
+ "content": "<non_speech>",
263
+ "lstrip": false,
264
+ "normalized": false,
265
+ "rstrip": false,
266
+ "single_word": false,
267
+ "special": false
268
+ },
269
+ "151676": {
270
+ "content": "<|audio_pad|>",
271
+ "lstrip": false,
272
+ "normalized": false,
273
+ "rstrip": false,
274
+ "single_word": false,
275
+ "special": true
276
+ },
277
+ "151677": {
278
+ "content": "<blank1>",
279
+ "lstrip": false,
280
+ "normalized": false,
281
+ "rstrip": false,
282
+ "single_word": false,
283
+ "special": true
284
+ },
285
+ "151678": {
286
+ "content": "<blank2>",
287
+ "lstrip": false,
288
+ "normalized": false,
289
+ "rstrip": false,
290
+ "single_word": false,
291
+ "special": true
292
+ },
293
+ "151679": {
294
+ "content": "<blank3>",
295
+ "lstrip": false,
296
+ "normalized": false,
297
+ "rstrip": false,
298
+ "single_word": false,
299
+ "special": true
300
+ },
301
+ "151680": {
302
+ "content": "<blank4>",
303
+ "lstrip": false,
304
+ "normalized": false,
305
+ "rstrip": false,
306
+ "single_word": false,
307
+ "special": true
308
+ },
309
+ "151681": {
310
+ "content": "<blank5>",
311
+ "lstrip": false,
312
+ "normalized": false,
313
+ "rstrip": false,
314
+ "single_word": false,
315
+ "special": true
316
+ },
317
+ "151682": {
318
+ "content": "<blank6>",
319
+ "lstrip": false,
320
+ "normalized": false,
321
+ "rstrip": false,
322
+ "single_word": false,
323
+ "special": true
324
+ },
325
+ "151683": {
326
+ "content": "<blank7>",
327
+ "lstrip": false,
328
+ "normalized": false,
329
+ "rstrip": false,
330
+ "single_word": false,
331
+ "special": true
332
+ },
333
+ "151684": {
334
+ "content": "<blank8>",
335
+ "lstrip": false,
336
+ "normalized": false,
337
+ "rstrip": false,
338
+ "single_word": false,
339
+ "special": true
340
+ },
341
+ "151685": {
342
+ "content": "<blank9>",
343
+ "lstrip": false,
344
+ "normalized": false,
345
+ "rstrip": false,
346
+ "single_word": false,
347
+ "special": true
348
+ },
349
+ "151686": {
350
+ "content": "<blank10>",
351
+ "lstrip": false,
352
+ "normalized": false,
353
+ "rstrip": false,
354
+ "single_word": false,
355
+ "special": true
356
+ },
357
+ "151687": {
358
+ "content": "<blank11>",
359
+ "lstrip": false,
360
+ "normalized": false,
361
+ "rstrip": false,
362
+ "single_word": false,
363
+ "special": true
364
+ },
365
+ "151688": {
366
+ "content": "<blank12>",
367
+ "lstrip": false,
368
+ "normalized": false,
369
+ "rstrip": false,
370
+ "single_word": false,
371
+ "special": true
372
+ },
373
+ "151689": {
374
+ "content": "<blank13>",
375
+ "lstrip": false,
376
+ "normalized": false,
377
+ "rstrip": false,
378
+ "single_word": false,
379
+ "special": true
380
+ },
381
+ "151690": {
382
+ "content": "<blank14>",
383
+ "lstrip": false,
384
+ "normalized": false,
385
+ "rstrip": false,
386
+ "single_word": false,
387
+ "special": true
388
+ },
389
+ "151691": {
390
+ "content": "<blank15>",
391
+ "lstrip": false,
392
+ "normalized": false,
393
+ "rstrip": false,
394
+ "single_word": false,
395
+ "special": true
396
+ },
397
+ "151692": {
398
+ "content": "<blank16>",
399
+ "lstrip": false,
400
+ "normalized": false,
401
+ "rstrip": false,
402
+ "single_word": false,
403
+ "special": true
404
+ },
405
+ "151693": {
406
+ "content": "<blank17>",
407
+ "lstrip": false,
408
+ "normalized": false,
409
+ "rstrip": false,
410
+ "single_word": false,
411
+ "special": true
412
+ },
413
+ "151694": {
414
+ "content": "<blank18>",
415
+ "lstrip": false,
416
+ "normalized": false,
417
+ "rstrip": false,
418
+ "single_word": false,
419
+ "special": true
420
+ },
421
+ "151695": {
422
+ "content": "<blank19>",
423
+ "lstrip": false,
424
+ "normalized": false,
425
+ "rstrip": false,
426
+ "single_word": false,
427
+ "special": true
428
+ },
429
+ "151696": {
430
+ "content": "<blank20>",
431
+ "lstrip": false,
432
+ "normalized": false,
433
+ "rstrip": false,
434
+ "single_word": false,
435
+ "special": true
436
+ },
437
+ "151697": {
438
+ "content": "<blank21>",
439
+ "lstrip": false,
440
+ "normalized": false,
441
+ "rstrip": false,
442
+ "single_word": false,
443
+ "special": true
444
+ },
445
+ "151698": {
446
+ "content": "<blank22>",
447
+ "lstrip": false,
448
+ "normalized": false,
449
+ "rstrip": false,
450
+ "single_word": false,
451
+ "special": true
452
+ },
453
+ "151699": {
454
+ "content": "<blank23>",
455
+ "lstrip": false,
456
+ "normalized": false,
457
+ "rstrip": false,
458
+ "single_word": false,
459
+ "special": true
460
+ },
461
+ "151700": {
462
+ "content": "<blank24>",
463
+ "lstrip": false,
464
+ "normalized": false,
465
+ "rstrip": false,
466
+ "single_word": false,
467
+ "special": true
468
+ },
469
+ "151701": {
470
+ "content": "<blank25>",
471
+ "lstrip": false,
472
+ "normalized": false,
473
+ "rstrip": false,
474
+ "single_word": false,
475
+ "special": true
476
+ },
477
+ "151702": {
478
+ "content": "<blank26>",
479
+ "lstrip": false,
480
+ "normalized": false,
481
+ "rstrip": false,
482
+ "single_word": false,
483
+ "special": true
484
+ },
485
+ "151703": {
486
+ "content": "<blank27>",
487
+ "lstrip": false,
488
+ "normalized": false,
489
+ "rstrip": false,
490
+ "single_word": false,
491
+ "special": true
492
+ },
493
+ "151704": {
494
+ "content": "<asr_text>",
495
+ "lstrip": false,
496
+ "normalized": false,
497
+ "rstrip": false,
498
+ "single_word": false,
499
+ "special": false
500
+ }
501
+ },
502
+ "additional_special_tokens": [
503
+ "<|im_start|>",
504
+ "<|im_end|>",
505
+ "<|object_ref_start|>",
506
+ "<|object_ref_end|>",
507
+ "<|box_start|>",
508
+ "<|box_end|>",
509
+ "<|quad_start|>",
510
+ "<|quad_end|>",
511
+ "<|vision_start|>",
512
+ "<|vision_end|>",
513
+ "<|vision_pad|>",
514
+ "<|image_pad|>",
515
+ "<|video_pad|>",
516
+ "<|audio_start|>",
517
+ "<|audio_end|>",
518
+ "<tts_pad>",
519
+ "<tts_text_bos>",
520
+ "<tts_text_bos_single>",
521
+ "<|audio_pad|>"
522
+ ],
523
+ "audio_bos_token": "<|audio_start|>",
524
+ "audio_eos_token": "<|audio_end|>",
525
+ "audio_token": "<|audio_pad|>",
526
+ "bos_token": null,
527
+ "clean_up_tokenization_spaces": false,
528
+ "eos_token": "<|im_end|>",
529
+ "errors": "replace",
530
+ "extra_special_tokens": {
531
+ "audio_bos_token": "<|audio_start|>",
532
+ "audio_eos_token": "<|audio_end|>",
533
+ "audio_token": "<|audio_pad|>",
534
+ "image_token": "<|image_pad|>",
535
+ "video_token": "<|video_pad|>",
536
+ "vision_bos_token": "<|vision_start|>",
537
+ "vision_eos_token": "<|vision_end|>"
538
+ },
539
+ "image_token": "<|image_pad|>",
540
+ "model_max_length": 131072,
541
+ "pad_token": "<|endoftext|>",
542
+ "processor_class": "Qwen3ASRProcessor",
543
+ "split_special_tokens": false,
544
+ "tokenizer_class": "Qwen2Tokenizer",
545
+ "unk_token": null,
546
+ "video_token": "<|video_pad|>",
547
+ "vision_bos_token": "<|vision_start|>",
548
+ "vision_eos_token": "<|vision_end|>"
549
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff