uetuluk2/MiraTTS-onnx-int4
By uetuluk2 · ↓ 2 · ♥ 1 · Updated 2025-12-26
What's in this repo
This page lists the files in uetuluk2/MiraTTS-onnx-int4, including model.onnx.
- 1 ONNX models (.onnx files)
- 14 files, including 8 .json, 1 .md, 1 .jinja, 1 .txt, 1 .onnx, 1 .data
- Last updated 2025-12-26
ONNX files
| File | Size | Download |
|---|---|---|
| model.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
MiraTTS ONNX INT4
This is an INT4 quantized ONNX version of YatharthS/MiraTTS, optimized for efficient CPU and GPU inference using ONNX Runtime with the GenAI extension.
Key Benefits
- ~2x faster inference compared to FP32 ONNX
- ~15x less memory usage (857MB vs 2.5GB+ for original)
- CPU-friendly: Runs efficiently on CPU without GPU
- Same quality: Negligible quality loss from quantization
Model Details
| Property | Value |
|---|---|
| Original Model | YatharthS/MiraTTS |
| Quantization | INT4 (4-bit weights) |
| Format | ONNX with GenAI extension |
| Size | ~857 MB |
| Sample Rate | 48 kHz |
Usage
Installation
pip install onnxruntime-genai torch soundfile
For GPU support:
pip install onnxruntime-genai-cuda torch soundfile
Python API
from huggingface_hub import snapshot_download
from mira.model import MiraTTS
import soundfile as sf
# Download model
model_path = snapshot_download("uetuluk2/MiraTTS-onnx-int4")
# Load model (use device="cuda" for GPU)
tts = MiraTTS(model_path, device="cpu")
# Encode reference audio for voice cloning
context = tts.encode_audio("reference.wav")
# Generate speech
audio = tts.generate("Hello, this is a test!", context)
# Save output
sf.write("output.wav", audio.cpu().numpy(), 48000)
With the MiraTTS-onnx Repository
git clone https://github.com/uetuluk/MiraTTS-onnx
cd MiraTTS-onnx
pip install -e .
# Download model
huggingface-cli download uetuluk2/MiraTTS-onnx-int4 --local-dir ./models/int4
# Run example
python examples/generate_int4.py --text "Hello world!" --reference your_voice.wav
Performance
Tested on various hardware configurations:
| Device | Generation Speed | Memory |
|---|---|---|
| CPU (Intel i7) | ~0.5x realtime | ~1.5 GB RAM |
| GPU (RTX 3080) | ~10x realtime | ~1 GB VRAM |
Quantization
This model was quantized using onnxruntime-genai with INT4 weight quantization:
python -m onnxruntime_genai.models.builder \
-m YatharthS/MiraTTS \
-e cpu \
-p int4 \
-o ./mira_onnx_int4
License
This model inherits the CC BY-NC-SA 4.0 license from the original MiraTTS model.
Credits
- Original model by YatharthS
- INT4 quantization by uetuluk2
- ONNX conversion code: MiraTTS-onnx
Model info
Created: 2025-12-26
Updated: 2025-12-26
View on Hugging FaceFiles (14)
Related models
More from uetuluk2
No other models by this author.