inoryQwQ commited on
Commit
b413289
·
verified ·
1 Parent(s): 336fd19

Release Hojo-TTS-Light-40M AX650/NPU3: C++ SDK + axmodels (host-KV LM, whisper-style U16 config)

Browse files
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hojo-TTS-Light-40M — AX650/NPU3 预编译模型 + C++ SDK
2
+
3
+ Hojo-TTS-Light-40M 中文/英文 TTS(24kHz,15 音色)在爱芯 AX650/NPU3 上的预编译部署包。
4
+ 全链路 NPU:LM(ax-llm s4/W4A16)+ fine_local + decoder。
5
+
6
+ ## 内容
7
+ - `models/`:预编译模型
8
+ - `lm_v1_60fix/`:LM 10 层 decode-only axmodel + post + embedding(Pulsar2 6.0 llm_build,s4/W4A16)
9
+ - `fine_local.axmodel`(INT8,cos 0.9997)
10
+ - `decoder_sq.axmodel`(SmoothQuant+U16,mag 0.998+ / phase 0.95-0.97)
11
+ - 音色 / 词典 / speaker_vecs / id2code / speaker_embeds
12
+ - `bin/`:C++ 可执行(AX650/aarch64)
13
+ - `hojo_tts_text`:纯 C++ 文本 → wav(内部完成 tokenizer + embedding 预处理)
14
+ - `hojo_tts_cpp` / `tts_driver`:调试用
15
+
16
+ ## 用法(板端)
17
+ ```bash
18
+ ./bin/hojo_tts_text \
19
+ models models/lm_v1_60fix/embed_tokens.bin models/speaker_embeds.bin \
20
+ models/lm_v1_60fix models/fine_local.axmodel models/decoder_sq.axmodel \
21
+ models/speaker_vecs.bin 0 models/id2code.bin \
22
+ "Hello, this is a test of the Hojo TTS system." voice_0 out.wav
23
+ ```
24
+ 输出 `out.wav`(24kHz)。音色索引 0-14(voice_ids 见 models/Hojo-TTS-Light-40M-voice.npz)。
25
+
26
+ ## 精度
27
+ - LM step0 logits cos 0.972(vs fp32 ONNX),top1 精确命中;decode ~162 tok/s
28
+ - 全链路 RTF≈0.4;端到端音频正常
29
+
30
+ ## 复现
31
+ 模型转换与 C++ SDK 构建源码见 GitHub:`ml-inory/hojo-tts-light.axera`
bin/hojo_tts_cpp ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28e4402aa3aec13384b5b2654b6ed68ddfa9ff990643bbbd8e41244b7ab88fae
3
+ size 1749984
bin/hojo_tts_text ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:787cfe80e303a2ed31c0cd73c31fe16147aca9872471049415cfe0752768d083
3
+ size 3100608
bin/tts_driver ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad8d073f8988ab8c48f59777528cb94f4918e655728b0fcf7946a5530f9e2325
3
+ size 1735680
models/Hojo-TTS-Light-40M-voice.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:048c23d0db973298cfb1e8d1d079b079ca039f656b35bd6298bc20cef0f43a3f
3
+ size 36724150
models/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 模型资产
2
+
3
+ | 组件 | 文件 | 说明 |
4
+ |------|------|------|
5
+ | LM (10 层 decode-only) | qwen3_p8_l0..9_together.axmodel + qwen3_post.axmodel + embed_tokens.bin + config.json + post_config.json + tokenizer.* | ax-llm s4(W4A16),Pulsar2 6.0 llm_build v1,kv_cache_len=2176 |
6
+ | fine_local | fine_local.axmodel | INT8,cos 0.9997 |
7
+ | decoder | decoder_sq.axmodel | SmoothQuant+U16,mag 0.998+/phase 0.95-0.97(接受) |
8
+ | 词典 | tokenizer.json / tokenizer_config.json | 原版 Hojo |
9
+ | 音色 | Hojo-TTS-Light-40M-voice.npz | token_embedding + speaker_embeds/vecs(15 音色) |
10
+
11
+ 板端部署路径示例:LM → /mnt/sdcard/hojo_sim/hojo_axllm/model_v1_60fix,
12
+ 其余 → /mnt/sdcard/hojo_e2e。
models/decoder_sq.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34c132fc5d6d33a2a8b2338b7a16a440f749bcb4e3f03e8b0ba9a49ccd2a67f7
3
+ size 36727167
models/fine_local.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e77842c02f3b04764576fb0f27778d1e0e706daf88eb942a12a7d4a4306226f8
3
+ size 32874686
models/id2code.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff4b7b9888c8ebb01ee865ac6f31086713e8e3362fa05f49ac24f95249b1b377
3
+ size 141480
models/lm_v1_60fix/config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "hojo-tts-light-40m-lm",
3
+ "tokenizer_type": "qwen3",
4
+ "url_tokenizer_model": "tokenizer.json",
5
+ "template_filename_axmodel": "qwen3_p8_l%d_together.axmodel",
6
+ "axmodel_num": 10,
7
+ "filename_post_axmodel": "qwen3_post.axmodel",
8
+ "filename_tokens_embed": "embed_tokens.bin",
9
+ "tokens_embed_num": 17685,
10
+ "tokens_embed_size": 512,
11
+ "prefill_token_num": 8,
12
+ "prefill_max_token_num": 32,
13
+ "kv_cache_num": 2048,
14
+ "kv_cache_size": 128,
15
+ "max_token_len": 2048,
16
+ "post_config_path": "post_config.json",
17
+ "b_bos": false,
18
+ "b_eos": false,
19
+ "use_mmap_load_embed": true
20
+ }
models/lm_v1_60fix/embed_tokens.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75f69ce61bcb60a9bd9ece10ba7004e5b7fdf8adf8a01de532a1be3969b98947
3
+ size 18109440
models/lm_v1_60fix/post_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "enable_repetition_penalty": false,
3
+ "repetition_penalty": 1.0,
4
+ "penalty_window": 20,
5
+ "enable_temperature": true,
6
+ "temperature": 0.0,
7
+ "enable_top_k_sampling": false,
8
+ "top_k": 1,
9
+ "enable_top_p_sampling": false,
10
+ "top_p": 1.0
11
+ }
models/lm_v1_60fix/qwen3_p8_l0_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00da80e558a2f81f2e59d3fe35d67394e61bf129e8a2355459cd4e66d099a01c
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l1_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e34f6e42f788a980299eab021189de079f6aae2504965d33dac0243b4cc4491
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l2_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ca0bc2d5ff6dc5860f38df5b14ae45d35e879e88fb71a87dbe0bbb7870101e6
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l3_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69ebe92f48eafeedc9e8c745f56d6a5668bc07d73d9671585d6bc7299a5c8290
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l4_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:868e991984edabc66c27a03c8982f7c7632a9bb9145610cc96b4cb5965b60d73
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l5_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc4160f5eaaca12e1cb083c6521f410ff3f66764fbdc09f74529a69e8b0dca94
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l6_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8338f7c122fd08fe4d31f513fc203e6efa7f6a87b2ff821566d1066080b309b8
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l7_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62b794d77d0bdc8cc50988be7fd61ea2ea868bce185712d939f9f401cf4b7efd
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l8_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71cfb46b41ebe0535392e1e7e406f45a345ad19e3b76e340957b88d58cbdf782
3
+ size 3512227
models/lm_v1_60fix/qwen3_p8_l9_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1301ba18807d3038284cef18d69eee2af45b86db8c64388a81bb4fe9f283f430
3
+ size 3512227
models/lm_v1_60fix/qwen3_post.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c362379210a8da051ead09bf87c8711b94895607c0af67f139400b61eac2f498
3
+ size 9883094
models/lm_v1_60fix/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/lm_v1_60fix/tokenizer.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/lm_v1_60fix/tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "[START]",
4
+ "bos_token_id": 2,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "[STOP]",
7
+ "eos_token_id": 3,
8
+ "is_local": true,
9
+ "max_length": null,
10
+ "model_max_length": 4096,
11
+ "pad_to_multiple_of": null,
12
+ "pad_token": "[STOP]",
13
+ "pad_token_id": 3,
14
+ "pad_token_type_id": 0,
15
+ "padding_side": "left",
16
+ "tokenizer_class": "TokenizersBackend",
17
+ "unk_token": "[UNK]",
18
+ "unk_token_id": 0
19
+ }
models/model_meta.json ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "hojo-tts-light-40m",
3
+ "task": "text-to-speech (24kHz, 15 voices), 3 模型流水线",
4
+ "note": "LM 为 host-KV 逐 token decode;fine_local/decoder 静态 T_MAX=2048(decoder 复制末行 padding 后截断)",
5
+ "models": {
6
+ "lm_decode": {
7
+ "file": "export/lm_decode.onnx",
8
+ "inputs": [
9
+ {
10
+ "name": "inputs_embeds",
11
+ "shape": [
12
+ 1,
13
+ 1,
14
+ 512
15
+ ],
16
+ "dtype": "float32",
17
+ "layout": "NCT",
18
+ "description": "token_embedding 查表 + 说话人 16 槽注入"
19
+ },
20
+ {
21
+ "name": "position_ids",
22
+ "shape": [
23
+ 1,
24
+ 1
25
+ ],
26
+ "dtype": "int64",
27
+ "layout": "N",
28
+ "description": "当前 token 绝对位置"
29
+ },
30
+ {
31
+ "name": "attention_mask",
32
+ "shape": [
33
+ 1,
34
+ 1,
35
+ 1,
36
+ 2049
37
+ ],
38
+ "dtype": "float32",
39
+ "layout": "NCHW",
40
+ "description": "0=有效槽(0..p-1 与槽2048), -3.38953e38=padding"
41
+ },
42
+ {
43
+ "name": "past_key_values.{0..9}.key/value",
44
+ "shape": [
45
+ 1,
46
+ 1,
47
+ 2048,
48
+ 128
49
+ ],
50
+ "dtype": "float32",
51
+ "layout": "NCHW",
52
+ "description": "host KV cache(compact 前缀,尾随零槽)"
53
+ }
54
+ ],
55
+ "outputs": [
56
+ {
57
+ "name": "logits",
58
+ "shape": [
59
+ 1,
60
+ 1,
61
+ 17685
62
+ ],
63
+ "dtype": "float32",
64
+ "description": "下一 token 分布"
65
+ },
66
+ {
67
+ "name": "last_hidden_state",
68
+ "shape": [
69
+ 1,
70
+ 1,
71
+ 512
72
+ ],
73
+ "dtype": "float32"
74
+ },
75
+ {
76
+ "name": "present.{0..9}.key/value",
77
+ "shape": [
78
+ 1,
79
+ 1,
80
+ 2049,
81
+ 128
82
+ ],
83
+ "dtype": "float32",
84
+ "description": "新 KV 在槽 2048(host 拷回缓存槽 p+1)"
85
+ }
86
+ ]
87
+ },
88
+ "fine_local": {
89
+ "file": "export/fine_local.onnx",
90
+ "inputs": [
91
+ {
92
+ "name": "hidden_states",
93
+ "shape": [
94
+ 1,
95
+ 2048,
96
+ 512
97
+ ],
98
+ "dtype": "float32",
99
+ "layout": "NTC",
100
+ "description": "LM last_hidden[audio_pos-1],尾部零 padding"
101
+ },
102
+ {
103
+ "name": "coarse_embeddings",
104
+ "shape": [
105
+ 1,
106
+ 2048,
107
+ 512
108
+ ],
109
+ "dtype": "float32",
110
+ "layout": "NTC",
111
+ "description": "token_embedding[coarse_token],尾部零 padding"
112
+ },
113
+ {
114
+ "name": "speaker_embedding",
115
+ "shape": [
116
+ 1,
117
+ 192
118
+ ],
119
+ "dtype": "float32",
120
+ "layout": "NC"
121
+ },
122
+ {
123
+ "name": "valid_mask",
124
+ "shape": [
125
+ 1,
126
+ 2048
127
+ ],
128
+ "dtype": "bool",
129
+ "layout": "N"
130
+ }
131
+ ],
132
+ "outputs": [
133
+ {
134
+ "name": "binary_logits",
135
+ "shape": [
136
+ 1,
137
+ 2048,
138
+ 128
139
+ ],
140
+ "dtype": "float32",
141
+ "description": ">0 -> +1, else -1(只取前 T 行)"
142
+ }
143
+ ]
144
+ },
145
+ "decoder": {
146
+ "file": "export/decoder.onnx",
147
+ "inputs": [
148
+ {
149
+ "name": "bits",
150
+ "shape": [
151
+ 2048,
152
+ 128
153
+ ],
154
+ "dtype": "float32",
155
+ "layout": "TC",
156
+ "description": "+-1 bits,尾部复制末行 padding"
157
+ }
158
+ ],
159
+ "outputs": [
160
+ {
161
+ "name": "mag",
162
+ "shape": [
163
+ 961,
164
+ 2048
165
+ ],
166
+ "dtype": "float32",
167
+ "description": "频谱幅度(只取前 T 列)"
168
+ },
169
+ {
170
+ "name": "phase",
171
+ "shape": [
172
+ 961,
173
+ 2048
174
+ ],
175
+ "dtype": "float32",
176
+ "description": "频谱相位(只取前 T 列)"
177
+ }
178
+ ]
179
+ }
180
+ },
181
+ "istft": {
182
+ "n_fft": 1920,
183
+ "hop_length": 480,
184
+ "win_length": 1920,
185
+ "padding": "same"
186
+ },
187
+ "sample_rate": 24000,
188
+ "lm_max_len": 2048,
189
+ "t_max": 2048,
190
+ "deployment": {
191
+ "target": "AX650 / NPU3",
192
+ "lm": "ax-llm s4(W4A16) decode-only 链: model_v1_60fix/qwen3_p8_l0..9_together.axmodel + qwen3_post.axmodel + embed_tokens.bin (Pulsar2 6.0 llm_build, kv_cache_len=2176)",
193
+ "fine_local": "compile/fine_local.axmodel (INT8, cos 0.9997)",
194
+ "decoder": "compile/decoder/decoder_sq.axmodel (SmoothQuant+U16, mag 0.998+/phase 0.95-0.97, 用户接受)",
195
+ "runtime_fix": "ax-llm LLM.cpp canonical_cap history_cap 修复 (patches/axllm_kv_row_width_fix.patch)",
196
+ "sdk": "sdk/python/hojo_tts_axllm.py (全链路) + sdk/cpp (tts_driver LM)",
197
+ "metrics": {
198
+ "lm_step0_cos": 0.972,
199
+ "lm_decode_tok_s": 162,
200
+ "fl_cos": 0.9997,
201
+ "dec_mag_cos": "0.998-0.9998",
202
+ "dec_phase_cos": "0.95-0.97 (用户接受)"
203
+ }
204
+ }
205
+ }
models/speaker_embeds.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:620c7a0cc34eb10596df654dd8df2c23b712af96b2e373e5130c88634ed9542e
3
+ size 491520
models/speaker_vecs.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc8d312eb7c9eaee4928ecb87ef0d978d6c0aa578b4a425e2d13cd503484f2de
3
+ size 11520
models/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "[START]",
4
+ "bos_token_id": 2,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "[STOP]",
7
+ "eos_token_id": 3,
8
+ "is_local": true,
9
+ "max_length": null,
10
+ "model_max_length": 4096,
11
+ "pad_to_multiple_of": null,
12
+ "pad_token": "[STOP]",
13
+ "pad_token_id": 3,
14
+ "pad_token_type_id": 0,
15
+ "padding_side": "left",
16
+ "tokenizer_class": "TokenizersBackend",
17
+ "unk_token": "[UNK]",
18
+ "unk_token_id": 0
19
+ }