hima-tts-nano-hi-ONNX
hima-tts-nano-hi (Hindi text to speech, 62M parameters) converted to ONNX, for fast speech on any CPU (Windows, Linux, Mac), with no PyTorch.
Same voices, same sound; int8 is 3.3x smaller and about 1.4x faster on a CPU, and reads as accurately as fp32 (checked on 1,202 sentences, below).
Built-in voices: Meera (female), Sneha (female), Nandini (female), Siddharth (male), Ishaan (male), Nikhil (male). Leave the voice out for a new random voice.
Install
pip install -U huggingface_hub
hf download Prahaladha/hima-tts-nano-hi-ONNX --local-dir hima-tts-nano-hi-ONNX
cd hima-tts-nano-hi-ONNX
pip install -r requirements.txt
Use it
from hima_onnx import OnnxTTS
tts = OnnxTTS(".", precision="int8") # or "fp32"
audio = tts.say("यार, आज office में इतना काम था कि lunch करने का भी time नहीं मिला।", voice="Meera")
audio = tts.say("यार, आज office में इतना काम था कि lunch करने का भी time नहीं मिला।") # a random voice
tts.save(audio, "hello.wav")
say returns float32 audio at 24 kHz. Pass seed= for the same take every time.
Your own voice
Copying a voice from a recording needs the main repo once (it uses PyTorch): python -m hima_tts --save-voice me.safetensors --from me.wav
inside hima-tts-nano-hi. Then use the file here: tts.say("...", voice_file="me.safetensors").
A random voice you like can be saved the same way (--save-voice calm.safetensors --seed 7).
Speed
Apple M4 Pro CPU, 48 sentences:
fp32 | int8 | |
|---|---|---|
| 4 threads | 10.3x real time | 15.4x |
| 1 thread | 6.5x | 10.8x |
| model files for one voice set | 273 MB | 84 MB |
In a browser (onnxruntime-web 1.23, one WASM thread, same graphs): fp32 2.9x and int8 2.3x real time;
int8 matrix kernels are slower than float ones in WASM, so there fp32 is faster and int8 is smaller.
How it reads
1,202 sentences (1,002 with the six voices, 200 with random voices), the same sentence and seed for both versions, read back by two speech recognizers (Sarvam saaras v4 and Hima ASR). Letters wrong counts an English word written in Hindi script or in Latin letters as the same word.
| Letters wrong (lower is better) | fp32 | int8 |
|---|---|---|
| Built-in voices, Sarvam saaras v4 | 2.94% | 2.56% |
| Built-in voices, Hima ASR | 3.77% | 3.36% |
| Random voices, Sarvam saaras v4 | 1.48% | 1.61% |
| Random voices, Hima ASR | 1.95% | 1.82% |
Line by line, int8 and fp32 differ by -0.20 points on Sarvam (95% interval -0.86 to
+0.43): the same accuracy.
What int8 changes: the speech model's matrix weights are 8-bit, except a few small layers at the input and output of the
flow head, which stay float32; the audio decoder's attention weights are 8-bit and its convolutions stay float32.
Files
| File | What it is |
|---|---|
onnx/base/, onnx/voices/ | the model as ONNX graphs, fp32 and int8; voices/ holds the version tuned for the six voices |
onnx/decoder.onnx | turns the model's output into audio |
onnx/decoder_int8.onnx | the same, used with precision="int8" |
prefix.safetensors | the few weights the code uses before the graphs |
hima_onnx/ | the code |
voices/voices.safetensors, voices/voices.json | the six voices' settings and names |
tokenizer.model, config.yaml | text tokenizer, model and sampling settings |
text/ | turns numbers, dates and amounts into words |