CoolFace
Modelpublic

touati-kamel/f5tts-algerian-darja

sourceHugging Faceapache-2.0updated 4d agoView on Hugging Face
0likes13kdownloads
Model Card

F5-TTS — Algerian Arabic (Darja) Fine-Tune

The first open-source F5-TTS model fine-tuned for Algerian Arabic (Darja / الدارجة الجزائرية), trained across ~399 hours of multi-domain dialectal speech on a single NVIDIA T4 GPU (16 GB VRAM).


Model Summary

PropertyValue
Base ModelIbrahimSalah/Arabic-F5-TTS-v2 (547,500-step Arabic checkpoint)
ArchitectureF5-TTS / DiT (dim=1024, depth=22, heads=18, conv\_layers=8)
LanguageAlgerian Arabic (Darja) + French/Berber code-switching
Sample Rate24,000 Hz
Vocabulary2,580 Arabic tokens
Total Training Steps48,574 updates (8 Kaggle sessions, Sep 20–23 2026)
Final Training Loss0.4950 (batch cross-entropy)
HardwareNVIDIA Tesla T4 (16 GB VRAM)
Best Checkpointmodel_last.pt — the only session that completed normally

Training Dataset

Fine-tuned on the OddAdmix Algerian Speech Collection — a multi-domain corpus of Algerian Darja spanning three distinct speech registers:

SubsetDomainRaw Utt.Filtered Utt.Duration
Kahwa PodcastConversational / Spontaneous23,26423,264~110h
Loubna StoriesExpressive Narratives48,59041,301~237h
Rawi FolkloreCultural Oral Folklore5,2964,501~52h
TotalMulti-Domain77,15069,066~399h

Data Preprocessing

  • —Resampled to 24,000 Hz mono float32 on-the-fly (streaming, no local disk)
  • —Duration filter: 2.0s ≤ duration ≤ 12.0s
  • —Character density filter: 1.0–25.0 chars/sec
  • —~85% utterance retention rate after quality filtering
  • —Darja-aware text normalization (see Text Normalization below)

Training Configuration

HyperparameterValue
Learning Rate2×10⁻⁵ (peak)
LR ScheduleCosine annealing with 2,000-step warmup
Total Updates48,574
Batch Size2,000 mel-frames / GPU
Gradient Accumulation6 steps (effective ~12,000 frames)
Max Grad Norm1.0
OptimizerAdamW 8-bit (bitsandbytes)
Mixed PrecisionFP16
Save IntervalEvery 500 updates
GPUNVIDIA Tesla T4 (16 GB VRAM)
PlatformKaggle (background run, multi-session)
MonitoringWeights & Biases — k_touati-estin/f5tts-algerian-darja

Architecture (DiT 8_18 config)

python
model_cfg = dict(
    dim=1024,
    depth=22,
    heads=18,
    ff_mult=2,
    text_dim=512,
    text_mask_padding=False,
    conv_layers=8,
    pe_attn_head=1,
    checkpoint_activations=True,   # gradient checkpointing for T4 VRAM
)
mel_spec_kwargs = dict(
    n_fft=1024,
    hop_length=256,
    win_length=1024,
    n_mel_channels=100,
    target_sample_rate=24000,
    mel_spec_type="vocos",
)

Training Sessions Log

Training was conducted across 8 Kaggle sessions from Sep 20–23 2026. Each session resumed automatically from the last uploaded checkpoint on Hugging Face Hub.

SessionRun IDDateSteps ReachedFinal LossStatus
1wxcxx3miSep 200—Setup/env error
2ymp61rc4Sep 2021.0581Setup/env error
3cknieh8fSep 209690.4266Kaggle time limit
4m2zoj7akSep 200—Setup/env error
5hniwvpbuSep 2113,2140.9916Kaggle time limit
6gyrlliysSep 2226,0141.1612Kaggle time limit
7zyah6mu2Sep 2238,8650.4460Kaggle time limit
8tk464wiiSep 2348,5740.4950Training complete
Note: Kaggle limits GPU sessions to ~12 hours. Each session resumed automatically from model_last.pt uploaded to HF Hub, allowing uninterrupted multi-session training. The wandb "crashed" status reflects Kaggle's process termination, not training errors — all sessions ran normally until the time limit.

Repository Files

FileDescription
model_last.ptBest/final model — step 48,574, the only session that completed
last-checkpoint/Kaggle async sync mirror of model_last.pt
Previous intermediate checkpoints (model_48000.pt, model_48500.pt) have been removed to reduce repository size. model_last.pt is the definitive final model.

Inference

Install

bash
pip install f5-tts huggingface_hub

Load Model

python
from huggingface_hub import hf_hub_download
import torch
from f5_tts.model import CFM, DiT
from f5_tts.model.utils import get_tokenizer

# Download weights and vocab
ckpt_path  = hf_hub_download("touati-kamel/f5tts-algerian-darja", "model_last.pt")
vocab_path = hf_hub_download("IbrahimSalah/Arabic-F5-TTS-v2", "vocab.txt")

vocab_char_map, vocab_size = get_tokenizer(vocab_path, "custom")

model = CFM(
    transformer=DiT(
        dim=1024, depth=22, heads=18, ff_mult=2,
        text_dim=512, text_mask_padding=False,
        conv_layers=8, pe_attn_head=1,
        text_num_embeds=vocab_size, mel_dim=100,
    ),
    mel_spec_kwargs=dict(
        n_fft=1024, hop_length=256, win_length=1024,
        n_mel_channels=100, target_sample_rate=24000,
        mel_spec_type="vocos",
    ),
    vocab_char_map=vocab_char_map,
)

ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=False)
model.load_state_dict(ckpt["ema_model_state_dict"], strict=False)
model.eval()

CLI Inference

bash
f5-tts_infer-cli \
  --ckpt_file model_last.pt \
  --vocab_file vocab.txt \
  --ref_audio  reference_darja.wav \
  --ref_text   "واش راك، كلشي مزيان؟" \
  --gen_text   "النص اللي تبغي تولدو بالدارجة الجزائرية" \
  --output_dir ./output

Text Normalization

Apply this normalization to input text before inference (same pipeline used during training):

python
import re

_FR_TAG_RE   = re.compile(r"\[\s*(?:French|FR)\s*:\s*(.*?)\]", re.IGNORECASE)
_BRACKET_RE  = re.compile(r"\[.*?\]|<.*?>|\(.*?\)")
_NOISE_CHARS = re.compile(r"[*#@~_\^&%$+=/\\|{}\[\]`\"«»]")

def normalize_darja(text: str) -> str:
    text = _FR_TAG_RE.sub(r"\1", text)          # expand [French:...] tags
    text = _BRACKET_RE.sub("", text)             # strip <laugh>, [FR:...] etc.
    text = _NOISE_CHARS.sub("", text)            # strip noise characters
    text = text.replace("\u0640", "")            # Kashida elongation
    text = text.replace("\u0625", "\u0627")      # إ → ا
    text = text.replace("\u0623", "\u0627")      # أ → ا
    text = text.replace("\u0622", "\u0627")      # آ → ا
    text = text.replace("\u0649", "\u064A")      # ى → ي (Alef Maqsura → Yaa)
    return " ".join(text.split()).strip()

Dialect Coverage

RegisterSourceCharacteristics
ConversationalKahwa PodcastFast-paced spontaneous speech, French/Darja code-switching, colloquial idioms
Expressive NarrativeLoubna StoriesRich emotional prosody, theatrical delivery, native Darja vocabulary
Cultural FolkloreRawiTraditional oral storytelling, regional dialectal expressions, proverbs

Limitations

  • —Single-speaker bias: The OddAdmix corpus derives from a small number of speakers; the model may reflect their vocal characteristics.
  • —Orthographic variation: Algerian Darja lacks a standardized script; non-standard orthography (e.g., ڨ vs ق for the Algerian gaf) may affect quality.
  • —Domain gap: Trained on clean podcast/storytelling audio — noisy or reverberant environments may reduce naturalness.
  • —Code-switching: French/Darja mixing works best with Latin-script French words; full Arabic transliteration of French may confuse the model.

Training Notes

  • —Multi-session strategy: Kaggle GPU sessions are limited to ~12 hours. Training was split across 8 sessions; each new session auto-resumed from model_last.pt on HF Hub — zero training progress was lost between sessions.
  • —Memory optimizations: gradient checkpointing (checkpoint_activations=True), 8-bit AdamW, num_workers=0, periodic gc.collect() + cuda.empty_cache().
  • —Base checkpoint reset: step/optimizer state stripped from model_547500_8_18.pt before fine-tuning to avoid momentum contamination from pre-training.
  • —Vocab: Reuses the 2,580-token Arabic vocab from IbrahimSalah/Arabic-F5-TTS-v2, compatible with Darja phoneme coverage.

Citation

bibtex
@misc{touati2026f5tts_darja,
  author       = {Kamel Touati},
  title        = {{F5-TTS Fine-Tuned for Algerian Arabic (Darja)}},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/touati-kamel/f5tts-algerian-darja}},
}

Related Resources

ResourceLink
Whisper ASR (Algerian Darja — Medium)touati-kamel/whisper-algerian-darja-medium
Whisper ASR (Algerian Darja — Small)touati-kamel/whisper-algerian-darja-small
Base TTS ModelIbrahimSalah/Arabic-F5-TTS-v2
WandB Training Logsk_touati-estin/f5tts-algerian-darja
F5-TTS FrameworkSWivid/F5-TTS

Trained by [Kamel Touati](https://huggingface.co/touati-kamel) · ESTIN, Setif, Algeria · September 2026