Instructions to use joehope/hr_HR-p2-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Piper
How to use joehope/hr_HR-p2-medium with Piper:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
hr_HR-p2-medium
A Croatian single-speaker Piper (VITS) text-to-speech voice, fine-tuned from a related-language checkpoint on speech. Medium quality, 22.05kHz.
Files
| Path | What it is |
|---|---|
fp32/hr_HR-p2-medium.onnx + .onnx.json |
Piper's native format, full 32-bit precision. Works out of the box with the Piper CLI. |
int8/hr_HR-p2-medium.int8.onnx + .onnx.json |
Dynamically quantized (QuantType.QUInt8), ~30% of the fp32 size. Faster, lower-quality β use only when you need the speed. |
sherpa-onnx/model.onnx + tokens.txt |
Ready-to-use sherpa-onnx bundle β the fp32 model with sherpa's metadata conventions stamped in, plus the phonemeβid table. espeak-ng-data is not bundled β see "Using sherpa-onnx + espeak-ng" below, it needs a specific copy, not just any system one. |
checkpoint/hr_HR-p2-medium-warmstart.ckpt |
PyTorch Lightning checkpoint with optimizer state stripped (~1/3 the original size). Use this to fine-tune your own Croatian voice β via Piper's --model.warmstart_ckpt, the same mechanism this voice itself was warmstarted from. Not meant for exact-resume (--ckpt_path), since optimizer state isn't included. |
Usage
Piper CLI (fp32 or int8):
piper -m fp32/hr_HR-p2-medium.onnx -c fp32/hr_HR-p2-medium.onnx.json \
-i text.txt -f out.wav
sherpa-onnx:
sherpa-onnx-offline-tts \
--vits-model=sherpa-onnx/model.onnx \
--vits-tokens=sherpa-onnx/tokens.txt \
--vits-data-dir=/path/to/espeak-ng-data \
--output-filename=out.wav "Dobar dan."
(the C++ CLI above needs a source build or prebuilt release binary β the pip wheel only ships the Python API; see "Using sherpa-onnx + espeak-ng" below for both, plus two real pitfalls that will otherwise cost you an afternoon.)
Fine-tune your own voice from this checkpoint:
python3 -m piper.train fit \
--model.warmstart_ckpt checkpoint/hr_HR-p2-medium-warmstart.ckpt \
--data.espeak_voice hr \
... # your own data.csv_path / audio_dir / etc.
Using sherpa-onnx + espeak-ng (tested end-to-end on a fresh machine)
Three real pitfalls, in the order you'll hit them:
- Pin
sherpa-onnx==1.10.46(pip install sherpa-onnx==1.10.46). The latest PyPI release (2.0.1as of 2026-11) silently fails to initialize the espeak frontend via the Python API: the model loads and reports its metadata correctly, but everygenerate()call fails with "phoneme_codepoints is empty, no lexicon, and no frontend available" and returns zero samples β no error at load time. Verified this is a wheel-level regression, not specific to this model, by reproducing the identical failure against sherpa-onnx's own official reference voice. - Get
espeak-ng-datafrom a sherpa-onnx release tarball, not your system's or Piper's copy β it must match the espeak build compiled into the sherpa-onnx wheel, not just be an espeak-ng-data:
(any language's tarball works β this data is phonemizer data, not voice-specific.)wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-lessac-medium.tar.bz2 tar xjf vits-piper-en_US-lessac-medium.tar.bz2 \ vits-piper-en_US-lessac-medium/espeak-ng-data --strip-components=1 - Python API needs
lexicon=""passed explicitly (no default in older builds):import sherpa_onnx, soundfile as sf vits = sherpa_onnx.OfflineTtsVitsModelConfig( model="sherpa-onnx/model.onnx", lexicon="", tokens="sherpa-onnx/tokens.txt", data_dir="/path/to/espeak-ng-data", ) tts = sherpa_onnx.OfflineTts( sherpa_onnx.OfflineTtsConfig(model=sherpa_onnx.OfflineTtsModelConfig(vits=vits)) ) audio = tts.generate("Dobar dan.", sid=0, speed=1.0) sf.write("out.wav", audio.samples, audio.sample_rate)
Training data and attribution
Trained on single speech, a corpus of Croatian speech.
Fine-tuned from a related-language Piper checkpoint (cross-lingual
warmstart β a standard, documented Piper workflow), itself sourced from
the rhasspy/piper-checkpoints dataset on HuggingFace.
License note β please read before redistributing
Treat these weights as CC BY-SA 4.0-encumbered until confirmed otherwise, and carry this notice forward with any redistribution.
- Downloads last month
- 80