inoryQwQ commited on
Commit
0629038
·
verified ·
1 Parent(s): afefd40

Replace with s8 build: LM s8 (Pulsar2 7.0 llm_build2), deterministic greedy generation, refreshed demo audio; drop stale lm_v1_60fix/binaries

Browse files
README.md CHANGED
@@ -11,48 +11,55 @@ tags:
11
  - en
12
  ---
13
 
14
- # Hojo-TTS-Light-40M — AX650/NPU3 预编译模型 + C++ SDK
15
 
16
  Hojo-TTS-Light-40M 中文/英文 TTS(24kHz,15 音色)在爱芯 AX650/NPU3 上的预编译部署包。
17
- 全链路 NPU:LM(ax-llm s4/W4A16)+ fine_local + decoder。
 
 
 
 
 
 
18
 
19
  ## 内容
20
  - `models/`:预编译模型
21
- - `lm_v1_60fix/`:LM 10 层 decode-only axmodel + post + embedding(Pulsar2 6.0 llm_builds4/W4A16
22
  - `fine_local.axmodel`(INT8,cos 0.9997)
23
  - `decoder_sq.axmodel`(SmoothQuant+U16,mag 0.998+ / phase 0.95-0.97)
24
  - 音色 / 词典 / speaker_vecs / id2code / speaker_embeds
25
  - `bin/`:C++ 可执行(AX650/aarch64)
26
- - `hojo_tts_text`:纯 C++ 文本 → wav(内部完tokenizer + embedding 预处理)
27
- - `hojo_tts_cpp` / `tts_driver`:调试用
28
 
29
  ## 用法(板端)
30
  ```bash
31
- ./bin/hojo_tts_text \
32
- models models/lm_v1_60fix/embed_tokens.bin models/speaker_embeds.bin \
33
- models/lm_v1_60fix models/fine_local.axmodel models/decoder_sq.axmodel \
34
- models/speaker_vecs.bin 0 models/id2code.bin \
35
- "Hello, this is a test of the Hojo TTS system." voice_0 out.wav
36
  ```
 
37
  输出 `out.wav`(24kHz)。音色索引 0-14(voice_ids 见 models/Hojo-TTS-Light-40M-voice.npz)。
38
 
39
- ## 示例音频(24kHz WAV,板端实生成)
40
 
41
- 中文示例(voice 0):
42
 
43
  <audio controls src="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_zh.wav">
44
  你的浏览器不支持音频播放,可<a href="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_zh.wav">下载中文示例</a>。
45
  </audio>
46
 
47
- 英文示例(voice 0):
48
 
49
  <audio controls src="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_en.wav">
50
  你的浏览器不支持音频播放,可<a href="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_en.wav">下载英文示例</a>。
51
  </audio>
52
 
53
- ## 精度
54
- - LM step0 logits cos 0.972(vs fp32 ONNX),top1 精确命中;decode ~162 tok/s
55
- - 全链路 RTF≈0.4;端到端音频正常
 
56
 
57
  ## 复现
58
- 模型转换与 C++ SDK 构建源码见 GitHub:`ml-inory/hojo-tts-light.axera`
 
11
  - en
12
  ---
13
 
14
+ # Hojo-TTS-Light-40M — AX650/NPU3 预编译模型 + C++ SDK(s8 修复版)
15
 
16
  Hojo-TTS-Light-40M 中文/英文 TTS(24kHz,15 音色)在爱芯 AX650/NPU3 上的预编译部署包。
17
+ 全链路 NPU:LM(ax-llm s8)+ fine_local + decoder。
18
+
19
+ 相对上一版的改进:
20
+ - LM 权重由 s4/W4A16 升级为 **s8**(Pulsar2 7.0 `llm_build2`),step0 logits 精度更高、长程生成更稳
21
+ - **修复生成随机性问题**:上一版 `temperature=0.0` 被运行时钳制为 1.0,实际退化为无种子 softmax 采样,
22
+ 导致每次生成完全不同、偶发近乎静音;本版固定为 argmax 确定性生成,相同输入多次运行 token 序列完全一致
23
+ - 示例音频已更新为修复版实机生成
24
 
25
  ## 内容
26
  - `models/`:预编译模型
27
+ - `lm_s8/`:LM 10 层 decode-only axmodel + post + embedding(Pulsar2 7.0 llm_build2s8/bf16 hidden
28
  - `fine_local.axmodel`(INT8,cos 0.9997)
29
  - `decoder_sq.axmodel`(SmoothQuant+U16,mag 0.998+ / phase 0.95-0.97)
30
  - 音色 / 词典 / speaker_vecs / id2code / speaker_embeds
31
  - `bin/`:C++ 可执行(AX650/aarch64)
32
+ - `hojo_tts_cpp` / `tts_driver`:LM 成 + 全链路出 wav
 
33
 
34
  ## 用法(板端)
35
  ```bash
36
+ ./bin/hojo_tts_cpp \
37
+ models/lm_s8 <embeds.bin> <num_tokens> 17659 128 \
38
+ models/fine_local.axmodel models/decoder_sq.axmodel \
39
+ models/lm_s8/embed_tokens.bin models/speaker_vecs.bin \
40
+ <voice_idx> models/id2code.bin out.wav
41
  ```
42
+ `<embeds.bin>` 为文本 prompt 的 BF16 embedding(50 token 示例见 `models/README.md` 说明),
43
  输出 `out.wav`(24kHz)。音色索引 0-14(voice_ids 见 models/Hojo-TTS-Light-40M-voice.npz)。
44
 
45
+ ## 示例音频(24kHz WAV,板端 s8 生成)
46
 
47
+ 中文示例(voice hojo_zh_f_01):
48
 
49
  <audio controls src="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_zh.wav">
50
  你的浏览器不支持音频播放,可<a href="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_zh.wav">下载中文示例</a>。
51
  </audio>
52
 
53
+ 英文示例(voice hojo_en_m_02):
54
 
55
  <audio controls src="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_en.wav">
56
  你的浏览器不支持音频播放,可<a href="https://huggingface.co/AXERA-TECH/Hojo-TTS-Light/resolve/main/audio/demo_en.wav">下载英文示例</a>。
57
  </audio>
58
 
59
+ ## 精度 / 性能
60
+ - LM s8:step0 top1 命中,前 30 步与 fp32 ONNX greedy 完全一致(量化累积后分叉属预期)
61
+ - decode ~175 tok/s;全链路 RTF≈0.43(decoder_sq)
62
+ - 生成确定性:相同输入多次运行 token 序列一致
63
 
64
  ## 复现
65
+ 模型转换(ONNX → HF safetensors → llm_build2)与 C++ SDK 构建源码见 GitHub:`ml-inory/hojo-tts-light.axera`
audio/demo_en.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:96a60540e7613ac34393973baff5c4035fb0b10e745230fb89af12025e77eb7f
3
- size 273644
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efeeacc71e5076e57cca0a0f92c4b627892d6bfcdf4f10ab74bd0f1bd8940ebd
3
+ size 122924
audio/demo_zh.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1f30a4f97231fb45bce57f84eac44c3c3e7b839ab00c165ea1faa9f39630701d
3
- size 172844
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b973311f4fb920314ff7bb3dbe8d9854e131b56dc1e321b765d083f7ee4c0a1
3
+ size 122924
bin/hojo_tts_cpp ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91c59eda37aea521a8f947f7d320af4a081ed06ceb911acdca6fa7f317483d99
3
+ size 1750088
bin/tts_driver ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:164853d790184c6275544a9fdb68ca66da37b0e8d5411e02af14f82ddb5d4d91
3
+ size 1735784
models/README.md CHANGED
@@ -2,11 +2,18 @@
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。
 
 
 
 
 
 
 
 
2
 
3
  | 组件 | 文件 | 说明 |
4
  |------|------|------|
5
+ | LM (10 层 decode-only) | lm_s8/qwen3_p8_l0..9_together.axmodel + qwen3_post.axmodel + embed_tokens.bin + config.json + post_config.json + tokenizer.* | ax-llm s8,Pulsar2 7.0 llm_build2,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
+ ## prompt embedding 生成(host 端)
12
+ ```bash
13
+ python tools/prepare_prompt_embeds.py \
14
+ --text "Hello, this is a demo from Hojo TTS Light." --voice 9 \
15
+ --models-dir origin/models --out-prefix demo_en
16
+ # 产物: demo_en.bin(BF16 [num_tokens,512])+ demo_en.meta.json
17
+ ```
18
+
19
+ 板端部署路径示例:LM → /mnt/sdcard/hojo_axllm/model_s8,其余 → /mnt/sdcard/hojo_e2e。
models/lm_s8/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_s8/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_s8/qwen3_p8_l0_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc3a47ab47e3977a25983fbcfc6befbe22f574d8ae976c31fd6d5e97f796fe94
3
+ size 4753708
models/lm_s8/qwen3_p8_l1_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:743010294d5c6a750b037b5667b83ed349709501efe85eec3c9464b789451df3
3
+ size 4753708
models/lm_s8/qwen3_p8_l2_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:420e583dfec8f13a56d41cc5c908fd9e56e1bb21ff5e70526dc2ce6f4025eb46
3
+ size 4753708
models/lm_s8/qwen3_p8_l3_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f93c7e2099bca7df23dcadf472d358afb35369e0c61585ea26585c47e3bfb43
3
+ size 4753708
models/lm_s8/qwen3_p8_l4_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc37aba4efb75af55e3f5bae2d5964c9857538eb9a0bcad3ae1e57e2a7602f81
3
+ size 4753676
models/lm_s8/qwen3_p8_l5_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:541b629eb74e6759f4126e319e9926431bdb2057dae5045bf3373d5221ceb697
3
+ size 4753676
models/lm_s8/qwen3_p8_l6_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d84463931a6cc3edd8e4c4590c72256cab33613f35ce09c27d7cee1c997daa98
3
+ size 4753676
models/lm_s8/qwen3_p8_l7_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:214897c151d3ca9214b232086c270570059e2f485954c69902f7a61eb1145edf
3
+ size 4753676
models/lm_s8/qwen3_p8_l8_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87f3a312d4e0e5a772caf8cfceb308d0c7c0057f4ed8924c696f6975f51a07d2
3
+ size 4753676
models/lm_s8/qwen3_p8_l9_together.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fee2a8b065259a3594a9b3b4dd9d315b42331c2b1cc47bd7f6c99cf481cce07
3
+ size 4753708
models/lm_s8/qwen3_post.axmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e77a910cdb32da098fc3f4c0dd59574efd54516bec2e101e0c045395aaa4733e
3
+ size 9883094
models/lm_s8/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
models/lm_s8/tokenizer.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/lm_s8/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
+ }