[ncnn] Qwen3-TTS 0.6B C++/ncnn 移植:Windows/Linux CPU FP32 任意文本推理 #352
mzyfc
started this conversation in
Show and tell
Replies: 2 comments 1 reply
|
Ok me book on 💁 |
0 replies
|
🫂🙏 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
本项目将
Qwen3-TTS-12Hz-0.6B-CustomVoice的确定性推理链路迁移到 C++/ncnn,目标是在不依赖 Python、PyTorch 或在线 API 的环境中完成文本到 24 kHz WAV 的生成。实现范围
2048 → 2048 → 1024文本投影。repetition_penalty=1.05和 codec token suppress 策略。Qwen3TTS::synthesize_to_file()API 和qwen3_tts_cli。pnnx 固定序列长度问题
pnnx 导出的 Transformer 图会把 trace 时的序列长度写入 Gemm 的
M参数和 Reshape 维度。Talker Prefill、Speech Decoder 和 Vocoder 因此不能直接处理其他文本长度或音频帧数。本项目保留共享权重
.bin,运行时只修改.param中与序列长度相关的字段,再通过ncnn::Net::load_param_mem()加载专门化参数。单 Token Decode 使用独立的长度 1 参数图,并复用 Prefill 权重。数值验收
2.25939e-065.69411e-063.72529e-06任意文本样本:
2.02656e-06。258.98 s。46.8491 s;与 Windows 输出长度一致,逐 int16 样本最大差异 1 LSB(142 个样本)。Windows Release CTest:
9/9通过,总时间约109.12 s。Linux Release CTest:9/9通过,总时间约258.98 s。使用方式
Windows:
Linux:
./build-linux-release/qwen3_tts_cli \ --model outputs/reference \ --text "这是一个新的语音合成测试。" \ --language Chinese \ --speaker Vivian \ --threads 4 \ --max-frames 48 \ --output result.wav当前限制
仓库地址:https://github.com/mzyfc/Qwen3-TTS-ncnn
上游项目:
All reactions