Configuration Parsing Warning:Config file config.json cannot be fetched (too big)
Nabra-82M โ Arabic Text-to-Speech
Nabra is an 82M-parameter neural text-to-speech model for Modern Standard
Arabic (MSA). It is a fine-tune of Kokoro-82M
(a StyleTTS2 / ISTFTNet architecture), adapted to Arabic phonetics with a
dedicated pharyngeal-consonant vocabulary and an Arabic grapheme-to-phoneme
front-end. It ships a single, natural female voice โ af_msa.
โ ๏ธ Nabra expects diacritized (tashkeel'd) input. Arabic drops short vowels in normal writing; without them the phonemizer guesses badly. Run text through a diacritizer first (see G2P pipeline).
Highlights
- ๐ฃ๏ธ Natural MSA speech at 24 kHz from a compact 82M model.
- ๐ค Arabic-aware phonemes โ the pharyngeal fricatives ุน (
ส) and ุญ (ฤง) get dedicated embedding slots (Kokoro vocab ids 7 & 8), preserving the ุน/ุก and ุญ/ู contrasts that generic phonemizers collapse. - ๐ฑ Runs on-device โ an MLX conversion (
oddadmix/Nabra-82M-MLX) runs fully offline on Apple Silicon / iOS via kokoro-ios. - โก Real-time factor < 1 on CPU for typical sentences.
Intended Use
- Arabic voice assistants, screen readers, and accessibility tools
- Audiobook / e-learning narration in MSA
- Voice output for on-device Arabic LLM pipelines (STT โ LLM โ diacritize โ Nabra)
Out of scope: dialectal Arabic (trained on MSA), singing, non-Arabic text, and speaker cloning (single fixed voice).
Usage
Nabra runs through the Kokoro pipeline with an Arabic front-end: normalize โ diacritize (camel-tools) โ phonemize (espeak-ng) โ synthesize.
# Install Kokoro from the Nabra fork โ it carries the Arabic config/vocab
pip install "kokoro @ git+https://github.com/Oddadmix/kokoro.git@main"
pip install torch soundfile huggingface_hub misaki camel-tools
# one-time: fetch the MSA diacritizer model (not shipped in the pip package)
camel_data -i disambig-mle-calima-msa-r13
# grab the Arabic G2P front-end
wget https://gist.githubusercontent.com/Oddadmix/dc699f7942a9516ce29d4842c7aed756/raw/827b541c892a862f9ef3b44006a6e27b100d1bdd/arabic_g2p.py
import numpy as np, torch, soundfile as sf
from huggingface_hub import hf_hub_download, list_repo_files
from arabic_g2p import ArabicG2P, EXTRA_SYMBOLS, clean_phonemes, normalize_text
from kokoro import KModel, KPipeline
from kokoro import pipeline as kpipeline_mod
REPO_ID = "oddadmix/Nabra-82M-v0.1"
files = list_repo_files(REPO_ID)
model_file = next(f for f in files if f.endswith(".pth")) # fine-tuned weights
voice_file = next(f for f in files if f.endswith(".pt")) # af_msa voicepack
config = hf_hub_download(REPO_ID, "config.json")
model_path = hf_hub_download(REPO_ID, model_file)
voice_path = hf_hub_download(REPO_ID, voice_file)
# Load OUR fine-tuned weights (config + model given โ base model is never fetched).
# disable_complex=True uses the real-valued STFT (robust on all GPUs).
kmodel = KModel(repo_id=REPO_ID, config=config, model=model_path,
disable_complex=True).eval()
kmodel.vocab.update(EXTRA_SYMBOLS) # สโ7, ฤงโ8
# Route the Kokoro pipeline through espeak-ng Arabic + phoneme cleanup
kpipeline_mod.LANG_CODES.setdefault("ar", "ar")
pipeline = KPipeline(lang_code="ar", repo_id=REPO_ID, model=kmodel)
_orig_g2p = pipeline.g2p
pipeline.g2p = lambda t: (clean_phonemes(_orig_g2p(t)[0]), _orig_g2p(t)[1])
voice = torch.load(voice_path, map_location="cpu", weights_only=True)
g2p = ArabicG2P(diacritize=True) # camel-tools MLE
# โโ Synthesize โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
text = "ู
ุฑุญุจุง ุจู ูู ูุจุฑุฉ" # raw MSA (tashkeel optional)
text_norm, _ = normalize_text(text)
diac = g2p.diacritize(text_norm) # โ ู
ูุฑูุญูุจูุง ุจููู ููู ููุจูุฑูุฉ
audios = [audio for _, _, audio in pipeline(diac, voice=voice, speed=1.0)]
wav = np.concatenate([a.detach().cpu().numpy() for a in audios]).astype(np.float32)
sf.write("nabra.wav", wav, 24000)
Already diacritized? Skip step 2 โ pass your tashkeel'd text straight to the
pipeline (pipeline(text, voice=voice)), or build ArabicG2P(diacritize=False).
- ๐ฎ Try it in the browser: Nabra-82M Demo Space
- ๐ฑ On-device (iOS / MLX):
oddadmix/Nabra-82M-MLX+ kokoro-ios (bundles neural diacritization, no camel-tools needed)
G2P Pipeline
Text is converted to phonemes in four stages so training and inference use an identical symbol set:
- Normalize โ strip citation markers and Latin-script loanwords, tidy whitespace.
- Diacritize โ restore MSA short vowels with camel-tools MLE (
calima-msa-r13). Skipped if the text is already diacritized. For a fully neural, on-device alternative, use CATT. - Phonemize โ espeak-ng Arabic (
ar) โ IPA. - Clean โ strip espeak's mid-word syllable dots (which would inject phantom
pauses) and pharyngealization/bracket markers; keep
ส/ฤง.
Model Details
| Base model | hexgrad/Kokoro-82M |
| Architecture | StyleTTS2 (PL-BERT text encoder + prosody predictor + ISTFTNet decoder) |
| Parameters | ~82M |
| Language | Modern Standard Arabic (ar) |
| Sample rate | 24 kHz, mono |
| Voices | af_msa (female) |
| Vocab | 178-token Kokoro table + สโ7, ฤงโ8 |
| Training | Fine-tuned with a patched StyleTTS2 |
Files & Formats
- This repo (
Nabra-82M-v0.1, PyTorch/KModel):kokoro_arabic.pth,af_msa.pt,config.json - MLX (
Nabra-82M-MLX):kokoro-v1_0.safetensors,af_msa.safetensors,config.json
Limitations & Notes
- Requires diacritized input for correct pronunciation.
- MSA only โ not trained for Egyptian or other dialects.
- Single voice (
af_msa); additional voices need more voicepacks.
Related
- ๐งฉ kokoro-ios โ MLX Swift inference (TTS + on-device Arabic diacritization)
- ๐ด Oddadmix/kokoro โ Kokoro fork with the Arabic config/vocab
- ๐ kikiri-tts โ upstream Kokoro/StyleTTS2 fine-tuning recipe
- ๐ค CATT โ Arabic diacritization (Apache-2.0)
Citation
@misc{nabra2026,
title = {Nabra-82M: Modern Standard Arabic Text-to-Speech},
author = {oddadmix},
year = {2026},
howpublished = {\url{https://huggingface.co/oddadmix/Nabra-82M-v0.1}}
}
License & Attribution
Released under Apache-2.0, following Kokoro-82M (Apache-2.0) and StyleTTS2 (MIT). Arabic diacritization in the pipeline uses camel-tools and/or CATT (Apache-2.0).
The fine-tuning recipe is built on kikiri-tts by @semidark โ the upstream Kokoro/StyleTTS2 training workflow this Arabic adaptation extends.
- Downloads last month
- 99