Instructions to use TEQUILA123/suxin-light with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Piper
How to use TEQUILA123/suxin-light with Piper:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Suxin-Light(苏心)
中英混合端侧 TTS:2865 万参数的 VITS 学生模型从 Fun-CosyVoice3-0.5B 蒸馏而来,波形由独创的 SuxinVoc 解码器生成(帧率输出、无上采样网络、单调相位映射 φ = π tanh(h))。在 8 核 Cortex-A55 上不依赖 NPU,4 线程即达实时速度的 6 倍。
On-device Mandarin–English TTS: a 28.65M-parameter VITS student distilled from Fun-CosyVoice3-0.5B, with the original SuxinVoc decoder (frame-rate output, no upsampling network, monotone phase map φ = π tanh(h)). On an 8-core Cortex-A55 it runs at six times real time with no NPU.
This repo ships the ONNX graphs deployed on an ARM Cortex-A55 edge device, and the frontend that runs them — pypinyin for Chinese, espeak-ng for English, PAD after syllable and word ends. Stock piper-tts cannot load phoneme_type: mixed. The student is a Piper VITS, not a CosyVoice fine-tune; teacher weights are not included.
本仓库为 ARM Cortex-A55 端侧设备上实际部署的 ONNX 图及配套前端(中文 pypinyin、英文 espeak-ng)。标准 piper-tts 无法加载 phoneme_type: mixed;学生模型是 Piper VITS,非 CosyVoice 微调,教师权重不在此处。
Samples
On-device performance (ARM)
测试平台:ARM Cortex-A55 端侧设备(8 核 @1.5 GHz)· Linux 6.1.83 · ONNX Runtime 1.23.2(CPU EP)· int8-excldec 图,warm 状态,RTF 取 3 次中位数。
RTF vs thread count
| threads | 1 | 2 | 3 | 4 | 6 |
|---|---|---|---|---|---|
| idle | 0.515 | 0.278 | 0.202 | 0.164 | 0.129 |
| +3 busy cores (ASR/VAD/KWS) | — | 0.282 | 0.205 | 0.167 | 0.212 |
单线程已快于实时;4 线程是推荐档位——负载下几乎不变(0.164 → 0.167),而 6 线程叠加负载会超发退化到 0.212。
vs Matcha zh-en on the same board
| threads | Suxin-Light int8 | Matcha + Vocos int8 | speed-up |
|---|---|---|---|
| 1 | 0.515 | 0.910 | 1.77× |
| 2 | 0.278 | 0.501 | 1.80× |
| 3 | 0.202 | 0.373 | 1.85× |
| 4 | 0.164 | 0.302 | 1.84× |
| 6 | 0.129 | 0.262 | 2.03× |
每一档都快 1.8–2.0 倍,加载快约 2.5 s,且两条线程扩展曲线形状一致。
vs published baselines
sherpa-onnx 数据来自树莓派 4(4×Cortex-A72)——A55 单核吞吐约为 A72 的 60–70%,靠 8 核弥补,此表仅作背景对照。
| model | RTF @4T | Size |
|---|---|---|
| Suxin-Light int8 (A55 ×8) | 0.164 | 67 MB |
| our Matcha zh-en, same board | 0.302 | 90 MB |
| matcha-icefall-zh-baker, mono zh (RPi 4) | 0.391 | 73 MB |
| en_US-lessac-medium, Piper VITS (RPi 4) | 0.357 | 61 MB |
| vits-melo-tts-zh_en (RPi 4) | 2.518 | 163 MB |
| kokoro-multi-lang-v1_1 (RPi 4) | 3.191 | 311 MB |
中英双语在端侧明显更重:表内单语模型 RTF 0.16–0.41,双语模型 2.5–3.2。
First-packet latency
RTF 0.164 却有 1.4 s 首包,瓶颈在流水线:切句要等句末标点,交叉淡化要扣压首块。首句在第一个逗号处切开、块间改淡出加 50 ms 静音后,两处等待消除。端到端首包(4 线程,毫秒):
| case | no split | aggressive split | Δ |
|---|---|---|---|
| short sentence, 36 chars | 1279 | 832 | −35% |
| short sentence, 39 chars | 1358 | 501 | −63% |
| long sentence, 118 chars | 1626 | 824 | −49% |
| no punctuation, 33 chars | 1465 | 1446 | 0 |
| median | 1411 | 828 | −41% |
中位 1411 → 828 ms,短句受益最大;无标点句无边界可切,几乎不变。TTS 纯推理首包 855 → 571 ms。参照:Picovoice 在 x86 桌面测得 Piper TTS 首包 1720 ms,本机已优于桌面 CPU;Orca 的 106 ms 靠真流式(不等标点),是下一步方向。
Recommended settings
intra_op_num_threads: 4,noise_scale/noise_w: 0,pad_mode: group,use_lang_tags: false,aggressive_first_sentence: true。加载加预热 14.3 s;合成音频回识 CER 0.128(误差集中在数字/单位归一化与中英混读的英文词)。
Files
| File | Size | Notes |
|---|---|---|
zh_en-suxin-light.int8-excldec.onnx |
67.3 MB | 默认图。QDQ int8,解码器 /dec/ 与时长链路保浮点 |
zh_en-suxin-light.int8-excldec.onnx.json |
6 KB | 音素表,22.05 kHz;inference.* 是 Piper 默认值,运行时覆盖 |
zh_en-suxin-light.onnx |
87.7 MB | fp32 原图 |
zh_en-suxin-light.onnx.json |
6 KB | 同音素表 |
suxin_tts/ |
— | 前端与合成器 |
infer.py |
— | CLI(suxin-tts 的薄封装) |
pyproject.toml / uv.lock |
— | uv 工程 |
不要全图 int8:会毁掉 iSTFT 头,并把 length_scale 钳在校准值上。本图排除解码器、时长链路及 scales 消费节点。
.onnx 与代码同目录;uv sync 只装 Python 包,不会搬权重,请在本目录运行或传 --model-dir。
Install
Python 3.10+(.python-version 即 3.10,与板子一致;此版本下锁文件钉住 onnxruntime==1.23.2,这是最后支持 cp310 的版本)。
uv sync
uv run suxin-tts "请到三号窗口办理 registration。" -o out.wav
piper-tts>=1.3 自带 EspeakPhonemizer 与 espeak-ng 数据。测试:uv sync --group dev && uv run pytest。不用 uv 时:pip install -r requirements.txt && python infer.py。fp32 图:--model zh_en-suxin-light.onnx。
from suxin_tts import SuxinTTS
tts = SuxinTTS.from_pretrained(".") # 目录下需有 .onnx 与 .onnx.json
audio = tts.synthesize_long("检验报告显示您的 blood sugar 偏高。")
# float32 mono, 22050 Hz
LLM token 流(与板子同策略,首句在首个逗号处切开):
async def tokens():
for ch in "您的检验报告已经出来了,blood sugar 指标偏高。":
yield ch
async for chunk in tts.synthesize_stream_from_tokens(tokens()):
... # chunk: float32, 22050 Hz
Runtime defaults
以下是 Python 默认值,与 .onnx.json 内的数字不同:
| Knob | Value | Why |
|---|---|---|
noise_scale / noise_w |
0.0 / 0.0 |
int8 在 Piper 的 0.667 / 0.8 下易出噪 |
pad_mode |
group |
PAD 只在声调/标点/空格后;Piper 的 each 会破坏本模型 |
use_lang_tags |
false |
<zh>/<en> 改变时长,且训练 ID 里没有 |
normalize_audio |
false |
RMS 增益会让短句发糊 |
aggressive_first_sentence |
true |
约 6 字或首个逗号即产首包 |
| threads | 4(8×A55) | 给 ASR/VAD/KWS 留核;6 线程负载下反而变慢 |
中文语境里的数字按汉字读(请到3号窗口),纯英文数字走 espeak(in his 30s)。
Quality
缓存后验上的解码器复合成(130 句配对 dev),即蒸馏目标,非走 prior 的端到端 TTS:
| log-mel | log-STFT | |
|---|---|---|
| HiFi-GAN teacher (256) | 0.314 | 0.745 |
| Suxin-Light (this repo) | 0.328 | 0.759 |
x86 单线程 RTF:fp32 0.034,int8-excldec 0.026。
Citation
@article{he2026suxin,
title = {Suxin-Light: Cached Latent Distillation and Monotone Phase Decoding
for On-Device Bilingual Text-to-Speech},
author = {He, Zongping},
year = {2026}
}
Acknowledgements
- Piper — VITS 引擎(GPL-3.0)
- Fun-CosyVoice3 — 教师模型
- espeak-ng、pypinyin
- ONNX Runtime
License
权重与本推理代码为 MIT;英文 G2P 经 piper-tts 引入 espeak-ng(GPL-3.0)。见 LICENSE。