Kabyle VITS for loom, text in, audio out
One GGUF holds the voice Phoonnx/phoonnx_kab-DZ_miro_o2i and its front end: the orthography2ipa Lua interpreter and the compiled kab-DZ rules. The file runs on the released engine, loom-py-rt 1.0.0. Input is Kabyle in the Latin orthography. Kabyle needs no text normalisation, so orthography2ipa is the whole front end.
pip install loom-py-rt==1.0.0
import loom, numpy as np
from huggingface_hub import hf_hub_download
model = loom.Model.from_file(hf_hub_download("TigreGotico/kab-DZ-miro-loom", "kab-DZ-miro-tts.gguf"))
text = "Azul fell-awen."
audio = np.asarray(model.call("infer", {"text": [ord(c) for c in text], "seed": 7}), dtype=np.float32) # 22050 Hz
ipa = "".join(chr(int(c)) for c in model.call("phonemize", {"text": [ord(c) for c in text]}))
infer({tokens = ids, seed}) takes the voice's phoneme ids as before.
Contents
| File | What it is |
|---|---|
kab-DZ-miro-tts.gguf | VITS graphs, the o2i interpreter and the kab-DZ IR. sha256 880b0c9a63b6d833a2656628d1c351ae22c609b7c94abec36f10a4d0aeb62fd0 |
sample1.wav ... sample3.wav | Audio from text through this file |
scripts/merge_frontend.py | Puts the o2i driver in front of an exported VITS |
scripts/oracle.py, scripts/parity.py, scripts/asr.py | The checks below |
The file records o2i.version (7.133.1a3), o2i.language and o2i.spec_revision (sha256:95d07b558acd360ba50ce8670d4affafd5916f54557fe071f9f25fbf41855001).
Checks
On loom-py-rt 1.0.0, Common Voice Kabyle sentences:
| Check | Result |
|---|---|
IPA from the file against Python orthography2ipa.transcribe(text, "kab-DZ"), 2000 sentences | 2000 identical |
| Audio from text against audio from phoonnx's own ids, same seed, 50 sentences | 50 identical |
| ASR WER, NVIDIA Kabyle conformer, 50 sentences | 0.360 (phoonnx ONNX voice: 0.372) |
| Real-time factor, laptop CPU | 0.039 |
Build
- Export the VITS checkpoint with loom-exporter (loom-ai-org/loom-exporter#101):
LOOM_PIPER_REPO=<dir with piper_train/vits = phoonnx_train/vits> loom-export epoch=2499-step=1950648.ckpt -o vits-kab.gguf, with the voice'sphoneme_id_mapJSON beside the checkpoint. python scripts/merge_frontend.py vits-kab.gguf kab-DZ-miro-tts.gguf kab-DZ <voice json>.