Instructions to use dove88/supertonic-zh with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Supertonic
How to use dove88/supertonic-zh with Supertonic:
from supertonic import TTS tts = TTS(auto_download=True) style = tts.get_voice_style(voice_name="M1") text = "The train delay was announced at 4:45 PM on Wed, Apr 3, 2024 due to track maintenance." wav, duration = tts.synthesize(text, voice_style=style) tts.save_audio(wav, "output.wav")
- Notebooks
- Google Colab
- Kaggle
π£οΈ Supertonic-ZH β v0.1.0-preview
Unofficial Mandarin (Chinese) text-to-speech Β· built on Supertonic-3.
Supertonic-3 is a fast, lightweight, on-device TTS family that does not synthesize Mandarin out of the box. Supertonic-ZH ships Mandarin as optimized, fused ONNX graphs (text encoder / duration predictor / vector estimator) that run in pure ONNX Runtime β no PyTorch. The vocoder is the frozen, unmodified upstream Supertonic-3 graph.
π Hear it first β demos + benchmark: github.com/wuxuedaifu/supertonic_cn (Mandarin, plus retained English / Russian / Arabic / French / Japanese / Korean from the base model).
π Gated / access
These weights are gated and provided on request under an evaluation license. Click "Request access" above. The current build is non-commercial only (Baker/CSMSC training data). Commercial licensing (a Baker-free build) is available separately β contact the author.
π¦ What's in this repo
| File | What it is |
|---|---|
text_encoder_zh.onnx |
Mandarin text encoder (fused / optimized ONNX) |
duration_predictor_zh.onnx |
Mandarin duration predictor (fused / optimized ONNX) |
vector_estimator_zh.onnx |
Mandarin flow / vector estimator (fused / optimized ONNX) |
unicode_indexer_zh.json |
Chinese Unicode tokenizer / vocabulary |
voice_zh.json |
Preset Mandarin voice (style embedding) |
example_infer.py |
Minimal pureβONNX Runtime inference example |
Not included β obtain from upstream:
vocoder.onnxβ the frozen base vocoder, from the upstream Supertone/supertonic-3 release (OpenRAIL-M).
Usage
1. Request access
Open this repository on Hugging Face, review the license conditions, and click Request access.
This release is for evaluation and non-commercial use only.
2. Install dependencies
pip install huggingface_hub onnxruntime numpy soundfile
For NVIDIA GPU inference, install ONNX Runtime GPU instead:
pip install huggingface_hub onnxruntime-gpu numpy soundfile
Do not install both onnxruntime and onnxruntime-gpu in the same environment.
3. Authenticate with Hugging Face
hf auth login
Use a Hugging Face access token belonging to an account that has been granted access to this repository.
4. Download Supertonic-ZH
hf download dove88/supertonic-zh \
--local-dir ./supertonic-zh
Alternatively, download it from Python:
from huggingface_hub import snapshot_download
model_dir = snapshot_download(
repo_id="dove88/supertonic-zh",
local_dir="./supertonic-zh",
)
print(f"Model downloaded to: {model_dir}")
5. Obtain the upstream vocoder
This repository does not redistribute vocoder.onnx.
Download vocoder.onnx from the official upstream repository:
Supertone/supertonic-3
Place it inside the downloaded model directory:
supertonic-zh/
βββ text_encoder_zh.onnx
βββ duration_predictor_zh.onnx
βββ vector_estimator_zh.onnx
βββ unicode_indexer_zh.json
βββ voice_zh.json
βββ example_infer.py
βββ vocoder.onnx
6. Generate speech
cd supertonic-zh
python example_infer.py \
"δ»ε€©ε€©ζ°εΎε₯½οΌζ们δΈθ΅·ε»ε
¬εζ£ζ₯ε§γ"
The generated audio is saved as:
out.wav
Python example
import subprocess
import sys
from pathlib import Path
model_dir = Path("./supertonic-zh")
script_path = model_dir / "example_infer.py"
required_files = [
"text_encoder_zh.onnx",
"duration_predictor_zh.onnx",
"vector_estimator_zh.onnx",
"unicode_indexer_zh.json",
"voice_zh.json",
"vocoder.onnx",
"example_infer.py",
]
missing_files = [
filename
for filename in required_files
if not (model_dir / filename).exists()
]
if missing_files:
raise FileNotFoundError(
"Missing required files: " + ", ".join(missing_files)
)
subprocess.run(
[
sys.executable,
str(script_path),
"ζ¬’θΏδ½Ώη¨ Supertonic δΈζθ―ι³εζ樑εγ",
],
cwd=model_dir,
check=True,
)
Included files
| File | Description |
|---|---|
text_encoder_zh.onnx |
Mandarin text encoder |
duration_predictor_zh.onnx |
Mandarin duration predictor |
vector_estimator_zh.onnx |
Mandarin flow/vector estimator |
unicode_indexer_zh.json |
Chinese character tokenizer and vocabulary |
voice_zh.json |
Preset Mandarin voice embedding |
example_infer.py |
Minimal ONNX Runtime inference script |
The upstream vocoder.onnx file is required but is not included in this repository.
See example_infer.py for the full ~60-line pipeline (tokenize β text encoder β duration β flow-matching loop β vocoder). No PyTorch required.
ποΈ Voice
Ships a single preset voice (voice_zh.json). Custom voice / voice cloning is a separate capability, not part of this release.
β οΈ Limitations
- Residual high-frequency artifact β bounded by the frozen upstream vocoder (never fine-tuned); a ceiling, not a bug.
- ChineseβEnglish code-switching is currently unreliable β embedded English words can be unclear (the Chinese fine-tune had no English data). On the roadmap.
- Tone / polyphone / erhua accuracy are model-inherent to the character-level acoustic model.
- Single preset voice.
Treat this as a feasibility preview, not a finished product.
π§Ύ License & attribution
- Base model: Supertonic-3, BigScience Open RAIL-M β its use-based restrictions (Attachment A) apply to this derivative and must be passed on to any downstream user.
- This build: additionally non-commercial only because of the Baker/CSMSC training data.
- Training data: AISHELL-3 (OpenSLR SLR93, Apache-2.0) + Baker/CSMSC (non-commercial).
Built on the publicly released Supertonic-3 model and sample code by Supertone Inc. This is an independent, unofficial extension.
- Downloads last month
- -