- Hadra-TTS XTTS-v2: Natural Algerian Darja Speech Synthesis
Hadra-TTS XTTS-v2: Natural Algerian Darja Speech Synthesis
Hadra-TTS XTTS-v2 is an autoregressive neural speech synthesis and voice-cloning model fine-tuned specifically for Algerian Arabic (Darja) and its characteristic Maghrebi-French code-switching patterns.
Based on the Coqui XTTS-v2 architecture, the model combines a causal Transformer language model with a Perceiver Resampler and a HiFi-GAN neural vocoder, enabling zero-shot voice cloning and multi-speaker synthesis with authentic Algerian phonology, regional consonants, and natural conversational cadence.
Interactive Benchmark Dashboard: https://hadra-xtts-benchmark.netlify.app
Model Architecture and Training Details
- Base Architecture: Coqui XTTS-v2 (Causal GPT + Perceiver Resampler + HiFi-GAN Vocoder)
- Parameters: ~1.8 Billion
- Training Precision: Full FP32 (eliminates NaN loss divergence and stabilizes cross-entropy convergence)
- Effective Batch Size: 126 (Physical batch size 1 with 126 gradient accumulation steps)
- Learning Rate: 5.0e-6 with AdamW optimizer
- Training Duration: 10 Completed Epochs on dual NVIDIA Tesla T4 GPUs
- Audio Sampling Rate: Native internal processing at 22,050 Hz; output upsampled to 24,000 Hz (16-bit Mono PCM)
- Primary Training Dataset: OddAdmix Algerian Speech Corpus (10,000 curated studio and podcast clips spanning Kahwa, Rawi, and Loubna collections)
Speaker Personas and Voice Cloning
The checkpoint includes pre-conditioned vocal formants for three canonical Algerian personas, while also supporting zero-shot voice cloning from arbitrary 3-to-10 second reference audio:
- Kahwa: Energetic conversational presenter and podcast host. Characterized by coastal urban cadence and native articulation of the voiced velar stop /g/ (as in "گاع" or "گالو").
- Rawi: Dignified classical narrator. Optimized for long-form narrative pacing, Casbah storytelling, and authentic preservation of the uvular stop /q/ (as in "قالك القاضي فالقصبة").
- Loubna: Clear, natural female voice with balanced pacing, well suited for educational content, dialogue, and documentary narration.
Zero-Shot Voice Cloning Requirements
To clone an unseen voice:
- Format: WAV file, 16-bit Mono PCM.
- Sample Rate: 22,050 Hz (recommended) or 24,000 Hz.
- Duration: 4 to 8 seconds of clean speech without background noise, music, or long leading/trailing silences.
Python Inference
1. High-Level Quickstart (TTS API)
The simplest method to synthesize speech using the standard Coqui TTS library:
import os
from TTS.api import TTS
# Initialize TTS with local checkpoint directory
tts = TTS(model_path=".", config_path="config.json").to("cuda")
# Synthesize Algerian Darja text
text = "صباح الخير والفل والياسمين على كامل ناس الجزائر العاصمة وخاوتنا وين ما كانو."
tts.tts_to_file(
text=text,
speaker_wav="references/kahwa_ref.wav", # Path to 3-8s reference WAV
language="ar",
file_path="output_darja.wav"
)
2. Advanced Production Pipeline (Native PyTorch with Darja Normalizer)
For production deployments, using the native Xtts class with the Darja pre-tokenization normalizer ensures optimal phonetic rendering and prevents token collapse on regional letters:
import re
import torch
import soundfile as sf
from TTS.tts.configs.xtts_config import XttsConfig
from TTS.tts.models.xtts import Xtts
# 1. Phonemic Normalizer for Algerian Darja Orthography
def normalize_darja_for_xtts(text: str) -> str:
"""
Normalizes Algerian Darja orthography to match XTTS-v2 BPE vocabulary.
Eliminates [UNK] token collapse while preserving authentic dialect pronunciation.
"""
# Map Western/Bedouin Gaf variants (گ, ݣ, ڨ) to canonical Arabic Qaf
text = text.replace("گ", "ق").replace("ݣ", "ق").replace("ڨ", "ق")
# Map borrowed Veh (ڤ) to Feh
text = text.replace("ڤ", "ف")
# Map borrowed Peh (پ) to Beh
text = text.replace("پ", "ب")
# Standardize French apostrophes
text = text.replace("’", "'").replace("`", "'")
# Normalize excessive whitespace
text = re.sub(r'\s+', ' ', text).strip()
return text
# 2. Load Model Architecture & Trained Checkpoint
config = XttsConfig()
config.load_json("config.json")
model = Xtts.init_from_config(config)
model.load_checkpoint(
config,
checkpoint_path="model.pth",
vocab_path="vocab.json",
eval=True
)
model.cuda()
# 3. Precompute Conditioning Latents from Reference Audio (once per voice)
reference_audio = "references/kahwa_ref.wav"
gpt_cond_latent, speaker_embedding = model.get_conditioning_latents(audio_path=[reference_audio])
# 4. Execute Calibrated Synthesis
input_text = "صحا خويا، راك en retard c'est bon، الطبيب راه يستنى فـ l'hôpital."
normalized_text = normalize_darja_for_xtts(input_text)
with torch.no_grad():
out = model.inference(
text=normalized_text,
language="ar",
gpt_cond_latent=gpt_cond_latent,
speaker_embedding=speaker_embedding,
temperature=0.65, # Calibrated for focused, crisp phoneme articulation
repetition_penalty=2.5, # Prevents phrase looping and runaway durations
length_penalty=1.0,
top_k=50,
top_p=0.85,
enable_text_splitting=True # Enables multi-clause narrative chunking
)
sf.write("output_calibrated.wav", out["wav"], 24000)
print("Synthesis complete: output_calibrated.wav")
5-Tier Production Linguistic Benchmark
Hadra-TTS XTTS-v2 was evaluated against the standardized Hadra 25-prompt stress test suite across all three speaker personas (75 total audio generations).
Full Interactive Report and Audio Players: https://hadra-xtts-benchmark.netlify.app
Performance Summary
| Metric Dimension | Measured Performance | Operational Significance |
|---|---|---|
| Total Benchmark Evaluations | 75 Audio Generations (25 Prompts x 3 Speakers) | Comprehensive coverage across colloquial, loanword, and phonological stress |
| Audio Pass Rate | 100.0% (75/75 PASS) | Zero digital clipping, zero dropped clauses, zero vocoder filter collapse |
| Average RTF (NVIDIA T4 GPU) | 0.262x (~3.8x faster than real-time playback) | Highly viable for server-side generation, conversational bots, and batch audio |
| Average Speech Formant Energy (<2kHz) | 93.8% | Clear human vocal resonance; authentic F1 and F2 formant articulation |
| High-Frequency Static Noise (>4kHz) | 3.6% | Clean studio background; high-frequency hiss completely eliminated |
| Spectral Centroid Range | 680 Hz to 820 Hz | Warm, natural human pitch contour without metallic or muffled artifacts |
| Consonant Zero-Crossing Rate (ZCR) | 0.055 to 0.125 | Crisp unvoiced and voiced consonant transitions (/s/, /sh/, /f/, /t/, /k/) |
Evaluation Tiers Tested
- Tier 1: Everyday Colloquial: Pan-Algerian greetings, hospitality invitations, cultural rhyming proverbs, and cafe banter.
- Tier 2: Code-Switching: Seamless blending of French technical, clinical, automotive, and administrative loanwords with Arabic clitics (فـ, بـ, للـ).
- Tier 3: Regional Phonology: Voiced velar /g/ vs classical uvular /q/, pharyngeal fricatives (/ع/ and /ح/), and emphatic consonants (/ط/, /ص/, /ض/).
- Tier 4: Numbers, Currency, and Tech: Complex Algerian financial phrasing (ملاين, فرنك), calendar dates, telephone numbers, and digital slang.
- Tier 5: Extreme Stress & Memory: Rapid phonemic tongue-twisters, ultra-short single-word commands ("صحة!"), and 46-word continuous traditional folk narratives.
Ecosystem Comparison
| Feature | Hadra-TTS XTTS-v2 | Hadra-TTS Kokoro 82M | Hadra-TTS Piper-VITS |
|---|---|---|---|
| Model Size | ~1.8 GB | 335.8 MB | 63.2 MB |
| Architecture | Causal GPT + Perceiver + HiFi-GAN | StyleTTS 2 + ISTFT | VITS + Stochastic Duration Predictor |
| Primary Strength | Expressive voice cloning & prosody | Lightweight server synthesis | Ultra-fast edge / CPU execution |
| Voice Cloning | Yes (Zero-shot from 3s reference) | Style vectors (Pre-extracted) | Fixed multi-speaker IDs |
| Target Hardware | NVIDIA GPU (T4, RTX 3090/4090, A100) | Modern GPU / Multi-core CPU | CPU first (Edge, Mobile, RPi) |
| Average RTF | 0.262x (GPU) | 0.380x (GPU) | 0.098x (CPU) |
Hardware and System Requirements
- GPU Inference (Recommended): NVIDIA GPU with at least 4 GB VRAM for FP32, or 2 GB VRAM for FP16.
- CPU Inference: Supported via PyTorch CPU fallback, though Real-Time Factor will increase to approximately 4.5x - 6.0x.
- Python Compatibility: Python 3.9 through Python 3.12 (Python 3.13 supported via Coqui-TTS 0.28+).
Ethical Considerations and Intended Use
Hadra-TTS XTTS-v2 was trained for research, educational, and cultural preservation purposes to advance North African speech technologies and under-resourced dialect processing.
Permitted Uses
- Academic research into Maghrebi Arabic dialects and code-switched speech synthesis.
- Accessibility tools, educational reading aids, and personal non-commercial projects.
- Digital preservation of authentic Algerian cultural storytelling and oral heritage.
Prohibited Uses
- Voice impersonation or deepfake generation intended to mislead, defraud, or impersonate real persons without consent.
- Automated unsolicited calling or deceptive telecommunications applications.
- Any deployment that violates the Coqui Public Model License non-commercial restrictions.
License
The model weights and assets in this repository are governed by the Coqui Public Model License 1.0.0 (CPML), which permits non-commercial research, personal experimentation, and educational applications.
For full license terms, refer to: https://coqui.ai/cpml
Citation and Attribution
If you utilize Hadra-TTS XTTS-v2 in your research or project, please cite:
@misc{hadra_xtts_2026,
author = {Touati, Kamel},
title = {Hadra-TTS XTTS-v2: Natural Algerian Darja Speech Synthesis and Voice Cloning},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/touati-kamel/Hadra-TTS-xtts}},
note = {Interactive benchmark: https://hadra-xtts-benchmark.netlify.app}
}
- Downloads last month
- 94
Model tree for touati-kamel/Hadra-TTS-xtts
Base model
coqui/XTTS-v2