moss-tts-local-onnx-cli
MOSS-TTS-Local-Transformer-v1.5 voice cloning via ONNX Runtime. Converted from the original PyTorch model (4.13B params, Qwen3 global + GPT2 local transformer).
Quick Start
One-liner with uvx (auto-downloads ~31GB models on first run):
uvx moss-tts-local-onnx-cli --text "你好,这是一段测试语音合成。" --reference ref.wav --output output.wav
Installation
# Install with uv
uv pip install moss-tts-local-onnx-cli
# Or with pip
pip install moss-tts-local-onnx-cli
# For ModelScope download support (China mainland):
pip install "moss-tts-local-onnx-cli[modelscope]"
CLI Usage
# Basic voice cloning
moss-tts-local-onnx-cli --text "你好" --reference speaker.wav --output output.wav
# With language hint
moss-tts-local-onnx-cli --text "Hello world" --reference speaker.wav --language English --output output.wav
# Download from ModelScope (China)
moss-tts-local-onnx-cli --text "你好" --reference speaker.wav --source modelscope --output output.wav
# Custom model directory
moss-tts-local-onnx-cli --text "你好" --reference speaker.wav --model-dir /path/to/models --output output.wav
Python API
from moss_tts_local_onnx_cli import MossTTS
# Initialize once (auto-downloads models)
tts = MossTTS()
# Generate multiple times without reloading
audio = tts.generate("你好,这是第一段。", reference="ref.wav", language="Chinese")
tts.save(audio, "output1.wav")
audio2 = tts.generate("这是第二段。", reference="ref.wav")
tts.save(audio2, "output2.wav")
# Or generate and save in one call
tts.generate("你好", reference="ref.wav", output="output3.wav")
Audio Codec
The audio codec (MOSS-Audio-Tokenizer-v2) is required for decoding audio tokens. It will be auto-detected from ~/.cache/modelscope/hub/models/OpenMOSS/MOSS-Audio-Tokenizer-v2.
To download it:
pip install modelscope
python -c "from modelscope import snapshot_download; snapshot_download('OpenMOSS/MOSS-Audio-Tokenizer-v2')"
Or specify a custom path:
tts = MossTTS(codec_path="/path/to/MOSS-Audio-Tokenizer-v2")
Model Conversion
To convert the original PyTorch model to ONNX yourself:
# Install export dependencies
pip install torch transformers onnx
# Run export (requires ~18GB RAM)
python scripts/export_onnx.py
# Validate correctness
python scripts/validate.py
See scripts/export_onnx.py for the full conversion pipeline.
Model Architecture
| ONNX Model | Description | Size |
|---|---|---|
global_prefill.onnx |
Qwen3 36-layer full-sequence forward | ~15GB |
global_decode.onnx |
Qwen3 single-token decode with KV cache | ~15GB |
local_transformer_first.onnx |
GPT2 1-layer (first step) | 290MB |
local_transformer.onnx |
GPT2 1-layer (with KV cache) | 290MB |
lm_heads.npz |
LM head weight matrices | 120MB |
Requirements
- Python >= 3.10
- ~32GB RAM (for loading models)
- ~31GB disk space (for model files)
License
MIT
Metadata
Release files for moss-tts-local-onnx-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| moss_tts_local_onnx_cli-0.1.1.tar.gz | 6.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moss_tts_local_onnx_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / moss_tts_local_onnx_cli-0.1.1.tar.gz
| Download URL | moss_tts_local_onnx_cli-0.1.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
216be08ffcb849395d1338c85cbf18e7418d39054aad5c4ff0cec901a784b66a
|
|
BLAKE2b-256 checksum How to use checksums |
bdce585f4720e85415c402deb31994818017b6e4255b0fcec3faa4f9398b0177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / moss_tts_local_onnx_cli-0.1.1-py3-none-any.whl
| Download URL | moss_tts_local_onnx_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34c921a27d6202c317c2398dd782bd1fa7d7d265ff5fb5f963fce0b1852e9f2d
|
|
BLAKE2b-256 checksum How to use checksums |
dcf0999e5d57056c26f659fd99d7a6e50db241b5807e16553377e9c9cf8a8bb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for moss-tts-local-onnx-cli 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.