Sofelia TTS 82M
A Palestinian Arabic text-to-speech model — Kokoro-82M fine-tuned for the Levantine/Palestinian dialect. Ships a single natural female voice, Eliaa.
- Architecture: Kokoro-82M (StyleTTS2 backbone, ISTFTNet vocoder), 82M params
- Sample rate: 24 kHz
- Speaker:
Eliaa(voices/eliaa.pt) - Runs on CPU in real time (RTF ≈ 0.15–0.34 on 4 threads)
Update — fixed "white noise / static" output. The previous
kokoro_sofelia_82M.pthstored its weight-norm layers under new-style keys (parametrizations.weight.original0/1, plusmodule.prefixes). Thekokoropackage (0.9.x) expectsweight_g/weight_v, and its loader silently falls back tostrict=False, so 182 tensors (text-encoder CNN, F0/energy predictor and most of the vocoder) stayed randomly initialised — the output was noise. The weights are now saved in the formatkokoroexpects and load completely. If you downloaded the model before this update, download it again (kokoro_sofelia_82M.pthandconfig.json).
Why a custom frontend
espeak-ng's Arabic G2P assumes Modern Standard Arabic and mis-handles dialect
text. sofelia_frontend.py fixes the systematic problems before phonemization:
- Arabic punctuation (
،؛؟) → Latin so the model receives pause/question cues - word-final
ةwrongly read as/t/for out-of-lexicon words → bare fatha (a) - a Palestinian pronunciation lexicon (
ar_lexicon.json) for words espeak mis-reads or strips vowels from (هيك,وين,تنين,قلت,معلش, …) ħ,ʕ,ˤare real tokens in the model vocab (config.json), so they are passed straight through — no phoneme remap is needed
Usage
pip install kokoro misaki espeakng-loader phonemizer-fork soundfile torch
python inference.py "بدي أروح ع السوق أشتري خضرة وفواكه للبيت."
Arabic has no Kokoro lang_code, so phonemize with misaki espeak-ng ar
(+ the Sofelia frontend) and call KModel directly — see inference.py.
Files
| File | Purpose |
|---|---|
kokoro_sofelia_82M.pth |
model weights (Kokoro KModel format) |
config.json |
Kokoro config (178-token vocab, incl. ħ ʕ ˤ) |
voices/eliaa.pt |
Eliaa speaker voicepack [510, 1, 256] |
sofelia_frontend.py |
Palestinian Arabic text frontend |
ar_lexicon.json |
dialect pronunciation lexicon (extensible) |
inference.py |
minimal end-to-end example |
Limitations
- Numbers/dates/times are read via espeak's MSA expansion; a dialect number normalizer is planned. Spell numbers out for best results.
- Single voice (Eliaa). The lexicon is small and community-extensible —
add
surface_word: diacritized_formentries to fix new words.
Credits
Fine-tuned from hexgrad/Kokoro-82M with a patched StyleTTS2 recipe. Dialect voice data: Sofelia Palestinian TTS.