الحاج شلبي
Hag Shalaby 0.2B
Egyptian Arabic · Text-to-Speech · Voice Cloning
About
Hag Shalaby 0.2B is an Egyptian Arabic TTS model fine-tuned from SILMA TTS v1 — a 150M-parameter bilingual (Arabic/English) model built on the F5-TTS flow-matching diffusion architecture.
It is designed for Egyptian Arabic pronunciation, conversational speech, and expressive voice generation while retaining reference-based voice cloning.
The model does not contain a permanently baked-in speaker identity. The generated voice is conditioned on the reference audio supplied at inference time.
Files
| File | Description |
|---|---|
model.pt | Fine-tuned F5-TTS checkpoint |
vocab.txt | SILMA character vocabulary (required) |
config.yaml | SILMA / F5-TTS model architecture config (required) |
text_v3.py | Training-time text normalization |
finetune_cli.py | SILMA-patched fine-tuning entry point |
ref.wav | Starter reference audio |
Important: use our
vocab.txtandconfig.yaml— F5-TTS's own defaults are incompatible with this checkpoint.
Usage
apt-get update && apt-get install -y ffmpeg
pip install -U f5-tts soundfile pyyaml
Use the latest
f5-tts(on Python 3.13,f5-tts==1.1.7pinsnumpy<=1.26.4, which has no 3.13 wheel).
import importlib.util
import soundfile as sf
import torch, yaml, torchaudio
from huggingface_hub import hf_hub_download
from f5_tts.model import DiT
from f5_tts.infer.utils_infer import load_model, load_vocoder, infer_process
# --- Route torchaudio.load through soundfile. This is the ONLY change needed
# to avoid torchcodec / libavutil errors; the rest is stock F5-TTS inference. ---
def _soundfile_load(path, *args, **kwargs):
data, sr = sf.read(str(path), dtype="float32", always_2d=True) # (frames, ch)
return torch.from_numpy(data).T, sr # (ch, frames)
torchaudio.load = _soundfile_load
repo = "nomeda-lab/hag-shalaby-tts-0.2B-v0.1"
model_pt = hf_hub_download(repo, "model.pt")
cfg_path = hf_hub_download(repo, "config.yaml")
vocab = hf_hub_download(repo, "vocab.txt")
text_v3 = hf_hub_download(repo, "text_v3.py")
ref_wav = hf_hub_download(repo, "ref.wav") # 24 kHz mono
spec = importlib.util.spec_from_file_location("text_v3", text_v3)
text_v3 = importlib.util.module_from_spec(spec)
spec.loader.exec_module(text_v3)
import inspect
arch = yaml.safe_load(open(cfg_path, encoding="utf-8"))["model"]["arch"]
arch = {k: v for k, v in arch.items()
if k in inspect.signature(DiT.__init__).parameters} # version-robust
device = "cuda" if torch.cuda.is_available() else "cpu"
model = load_model(DiT, arch, model_pt, "vocos", vocab, "euler", False, device)
vocoder = load_vocoder("vocos", device=device)
# Standard F5 inference: reference text is prepended and used for length control.
wav, sr, _ = infer_process(
ref_wav, # reference audio
"", # reference transcript ("" -> auto-transcribe)
text_v3.normalize_v3("قلبي بيحبك يا حاج شلبي"),
model, vocoder, "vocos",
nfe_step=32, cfg_strength=2.0, device=device,
)
sf.write("out.wav", wav, sr)
print("wrote out.wav", sr)
To skip the (one-time) Whisper download, pass the reference transcript instead of
"":infer_process(ref_wav, "نص المقطع المرجعي", ...).
Text Normalization
Always use
normalize_v3()
The normalization pipeline is part of the model's expected input distribution. It handles the text transformations used during training, including:
- Alef variants
- Hamza
- Egyptian qaf behavior
- Number verbalization
- Other training-time normalization
Avoid manually replacing characters after normalization. Use:
text = text_v3.normalize_v3(text)
Reference Audio
Use a clean 6–15 second recording from a single speaker.
The reference audio strongly affects the generated voice. You can replace the included reference with your own:
ref_file="your_reference.wav"
Requirements
- Python 3.10+
pip install -U f5-tts soundfile pyyaml- See
requirements.txt
Limitations
- Reference audio quality strongly affects the output.
- Egyptian dialect pronunciation is not perfectly consistent.
- Colloquial Arabic receives limited automatic diacritization.
- Number verbalization does not guarantee complete grammatical agreement.
- Highly expressive or unusual inputs may produce unstable prosody.
- The model has not been comprehensively evaluated for production deployment.
Attribution
Base model: SILMA TTS v1 — SILMA AI (Apache-2.0) Architecture: F5-TTS — SWivid (MIT License)
Training datasets, recordings, and third-party components retain their respective licenses.
Source recordings remain the property of their creators. This release does not transfer rights to any narrator's voice or likeness.
Do not use the model to impersonate a real person without appropriate authorization.
License
Apache-2.0 — inherited from the base model.
Third-party components and datasets remain subject to their respective licenses.
الحاج شلبي
Hag Shalaby 0.2B · nomeda-lab