Downloads · 30 days
0
MiaoMint/MeloTTS-ONNX
MeloTTS-ONNX is a machine learning model from MiaoMint. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A script to convert MeloTTS models to ONNX format for use with sherpa-onnx.
Downloads · 30 days
0
Access
Public
Updated Apr 10, 2026
Repo size
2.6 GB
Likes
1
Public
Click a slice to open those files.
.onnx1.2 GB · 99%
From the Hugging Face model README
A script to convert MeloTTS models to ONNX format for use with sherpa-onnx.
| Code | Language | Speakers | Lexicon source |
|---|---|---|---|
| zh | Chinese | 1 | pypinyin dict + CMU English |
| en | English | 5 | CMU eng_dict |
| en_v2 | English (v2) | 4 | CMU eng_dict |
| en_newest | English (v3) | 1 | CMU eng_dict |
| ja | Japanese | 1 | wordfreq top-10000 + MeCab/unidic |
| fr | French | 1 | wordfreq top-10000 + melo g2p |
| es | Spanish | 1 | wordfreq top-10000 + gruut |
| ko | Korean | 1 | wordfreq top-10000 + hangul jamo |
Note: English (en, en_v2, en_newest) and Chinese (zh) models include English words in their lexicon for mixed-language support. Monolingual models (ja, fr, es, ko) do not include English words.
# Install dependencies and export a model (default: ko)
./run.sh ko
# Export a specific language
./run.sh fr
pip install -r requirements.txt
python -m unidic download # required for Japanese
python export-onnx.py --language zh
python export-onnx.py --language <LANG> [options]
--language zh | en | en_v2 | en_newest | ja | fr | es | ko (default: ko)
--output Output directory (default: ./onnx_exports/<LANG>/)
--device cpu | cuda (default: auto-detect)
--opset ONNX opset version (default: 18)
onnx_exports/<lang>/
├── model.onnx # ONNX model with embedded metadata
├── tokens.txt # Phoneme symbol → index mapping
├── lexicon.txt # Word → phoneme + tone mapping
└── metadata.json # Model metadata (language_code, sample_rate, speakers, …)
word phone1 phone2 ... tone1 tone2 ...
Chinese and English models include English words for mixed-language pronunciation. Monolingual models (ja, fr, es, ko) contain only target language vocabulary.
The export script wraps the MeloTTS SynthesizerTrn model in a ModelWrapper that:
torch.onnx.exportNote: BERT embeddings are zeroed out, so voice quality may differ slightly from the original PyTorch model.
MeloTTS is licensed under MIT. See MeloTTS for details.