--- license: apache-2.0 language: - kln base_model: hexgrad/Kokoro-82M pipeline_tag: text-to-speech tags: - kalenjin - kokoro - styletts2 - onnx datasets: - Anv-ke/Kalenjin --- # Kakara: Kalenjin text-to-speech Kakara speaks **Kalenjin**. It is [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) (82 M parameters) fine-tuned on about 290 hours of Kalenjin speech, and it runs faster than real time on an ordinary laptop CPU, with no GPU and no PyTorch. Three voices: **female**, **male**, and **blend** (an average of many speakers). ## Use ```bash pip install onnxruntime numpy soundfile huggingface_hub ``` ```python from huggingface_hub import snapshot_download import sys; path = snapshot_download("KalenjinAI/kakara"); sys.path.insert(0, path) from kakara import Kakara tts = Kakara(path) tts.save("Chamgei, amache ityem modelit ni kibare Kakara.", "out.wav", voice="female") # 24 kHz WAV audio = tts("Abaibai amun keib kasarta ityem.", voice="male") # numpy array ``` Command line, from the downloaded folder: `python kakara.py "Chamgei, amache ityem modelit ni kibare Kakara." --voice male --out out.wav` Text is converted to phonemes by rule (`kln_g2p.py`), with English loanwords recognised and pronounced as English (`kln_english.py`). Numbers are read out in Kalenjin. No espeak is needed. PyTorch users can load `kakara.pth` with `kokoro.KModel(repo_id="hexgrad/Kokoro-82M", config="config.json", model="kakara.pth")` and pass `torch.from_numpy(np.load("voices/female.npy"))[len(phonemes) - 1]` as the voice. ## Samples Generated with `speed=1.3`. | | female | male | blend | |---|---|---|---| | Kongoi missing en toretet ne koigonan amun koanetkee tuguk chechang' chebo muswoknatet. | | | | | Ye kiger sugul en arawet ne isibu, atinye tuiyet nebo chaik en Kericho tarigit taman ak sisiit. | | | | | Kaitit yu missing, kaatuch gee ak branketisiek mut che nyigisen ago kaitit kora. | | | | ## Evaluation 20 held-out sentences (never seen in training) from one speaker, compared with the real recordings of those sentences and with our previous model. | System | Judge CER ↓ | UTMOS ↑ | Speaking rate (phonemes/s) | |---|---|---|---| | Real recordings (held-out speaker) | 0.129 | 2.81 | 10.7 | | Kalenjin TTS v1 (F5-TTS) | 0.092 | 2.69 | 12.0 | | **Kakara · female** | 0.075 | 3.25 | 8.7 | | **Kakara · male** | 0.066 | 3.25 | 9.3 | | **Kakara · blend** | 0.070 | 3.34 | 8.2 | - **Judge CER**: character error rate of [Rekody/whisper-large-v3-turbo-kalenjin](https://huggingface.co/Rekody/whisper-large-v3-turbo-kalenjin) transcribing the audio. Lower means easier to understand. The real recordings score worse than the synthetic voices because they are phone recordings with room noise and natural slurring; synthetic speech is clean and evenly paced. - **UTMOS** ([utmos22_strong](https://github.com/tarepan/SpeechMOS)): a predicted 1–5 listener naturalness rating. It was trained on English and Japanese listening tests, so it reflects audio quality, not how native the Kalenjin sounds. - **Speed on CPU** (laptop, onnxruntime, fp32): real-time factor **0.18** on all cores and 0.56 on one core (seconds of compute per second of audio). TTS v1 (F5-TTS) needs 13–17 s per second of audio on the same CPU. ## Limitations - **Pace.** Speech is about 15 % slower than the real speakers, and short phrases (a word or two) sound slowest. Use `speed=1.1`–`1.3` for short phrases; 1.0 suits longer sentences. - **Pronunciation comes from spelling rules.** Names, loanwords spelled the Kalenjin way, and words whose tone or vowel length is not written may be read wrongly. - **Intonation** is learned from read and conversational recordings. Questions and emotion are only partly expressed. - Only tested on Kalenjin as spelled in the training transcripts; other spelling conventions may be read differently. ## Training - **Recipe:** [semidark/kikiri-tts](https://github.com/semidark/kikiri-tts) (StyleTTS2 training for Kokoro), adapted to Kalenjin. - **Stage 1:** all 552 speakers (about 290 h), 4 epochs. - **Stage 2:** fine-tuned on five selected voices. - **Release checkpoint:** step 2,882 of stage 2, before the adversarial phase; it scored best on the held-out benchmark. - **Hardware:** one RTX PRO 6000 GPU, about a day of training in total. ## Data and credit Trained on the **ANV Kalenjin dataset** ([Anv-ke/Kalenjin](https://huggingface.co/datasets/Anv-ke/Kalenjin)), licensed **CC BY 4.0**. Thank you to ANV and to everyone who recorded their voice for it. The base model is Kokoro-82M by hexgrad (Apache-2.0). ## Responsible use The voices are derived from real people who recorded speech for a public dataset. Do not use Kakara to impersonate anyone, to deceive listeners, or to put words in a real person's mouth. Label synthetic speech as synthetic where listeners could mistake it for a person.