Downloads · 30 days
25
36% of all-time downloads
TheBOrganization/Arabic_TTS
Arabic_TTS is a text-to-speech model from TheBOrganization. Use it when you need text read aloud. It is set up for vibevoice. The card lists the license as apache-2.0.
<div align="center" <h3High-Fidelity, Zero-Shot Arabic Text-to-Speech</h3 <pBringing natural, expressive, and culturally accurate Arabic speech to life.</p </div
Downloads · 30 days
25
36% of all-time downloads
All-time downloads
69
Public
Parameters
2.7B
5.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.4 GB · 100%
From the Hugging Face model README
Arabic_TTS is a state-of-the-art Text-to-Speech model specifically optimized for the Arabic language. Built on the powerful VibeVoice architecture, this model goes beyond standard TTS by offering zero-shot voice cloning.
Simply provide a short reference audio clip, and the model will synthesize your input text in Arabic while perfectly capturing the timbre, tone, and unique characteristics of the reference speaker.
Listen to the quality of the model below. We compare the original reference voice against the synthetic generated output.
<table> <thead> <tr> <th align="center">🎤 Original Reference Voice</th> <th align="center">🤖 Synthetic Generated Voice</th> </tr> </thead> <tbody> <tr> <td align="center"> <audio controls> <source src="https://huggingface.co/theBOrganization/Arabic_TTS/resolve/main/audio/samp_2.ogg" type="audio/wav"> Your browser does not support the audio element. </audio> </td> <td align="center"> <audio controls> <source src="https://huggingface.co/theBOrganization/Arabic_TTS/resolve/main/audio/samp_1.ogg" type="audio/wav"> Your browser does not support the audio element. </audio> </td> </tr> </tbody> </table>Ensure you have PyTorch installed. You will also need the vibevoice library.
pip install torch torchaudio
# Install vibevoice (adjust based on your specific package distribution)
pip install vibevoice
Below is the complete script to load the model, process the text and reference audio, and generate high-quality 24kHz speech.
import os
import torch
import torchaudio as ta
from vibevoice.processor.vibevoice_processor import VibeVoiceProcessor
from vibevoice.modular.modeling_vibevoice_inference import VibeVoiceForConditionalGenerationInference
# --- Configuration ---
model_path = "theBOrganization/Arabic_TTS"
text = "SPEAKER 1: مرحبا، هذا مثال على توليد الصوت باللغة العربية باستخدام نموذج جديد."
output_path = "output.wav"
# Device selection with fallback
device = "cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
print(f"🚀 Loading model on {device}...")
# Load Processor
processor = VibeVoiceProcessor.from_pretrained(model_path)
# Set dtype and attention implementation based on device
if device == "mps":
dtype = torch.float32
elif device == "cuda":
dtype = torch.bfloat16
else:
dtype = torch.float32 # Note: float32 is recommended for CPU stability
attn_impl = "sdpa"
# Load Model
model = VibeVoiceForConditionalGenerationInference.from_pretrained(
model_path,
torch_dtype=dtype,
attn_implementation=attn_impl,
device_map=device if device != "mps" else None,
)
if device == "mps":
model.to("mps")
model.eval()
model.set_ddpm_inference_steps(10) # 10 steps for DDPM inference
# --- Prepare Inputs ---
reference_voice = "prompt.wav" # Replace with your reference audio path
print(f"🎙️ Using reference voice: {reference_voice}")
inputs = processor(
text=[text],
voice_samples=[[reference_voice]], # Batch of one speaker list
return_tensors="pt",
padding=True,
)
# Move tensors to the correct device
inputs = {
k: v.to(device) if torch.is_tensor(v) else v
for k, v in inputs.items()
}
# --- Generate Audio ---
print("🎧 Generating audio...")
with torch.no_grad():
outputs = model.generate(
**inputs,
cfg_scale=1.3,
tokenizer=processor.tokenizer,
generation_config={
'do_sample': True,
'temperature': 0.5
},
)
# --- Save Output ---
audio = outputs.speech_outputs[0].cpu().float() # shape: [1, T] or [T]
if audio.ndim == 1:
audio = audio.unsqueeze(0).float()
sample_rate = 24000
ta.save(output_path, audio, sample_rate)
print(f"✅ Successfully saved audio to {output_path}")
The model expects text to be prefixed with a speaker identifier.
SPEAKER X: <Your Arabic Text Here>SPEAKER 1: أهلاً وسهلاً بكم في موقعنا.| Feature | Specification |
|---|---|
| Architecture | VibeVoice (Diffusion / Flow-Matching based) |
| Sampling Rate | 24,000 Hz |
| Inference Steps | 10 (DDPM) |
| Supported Languages | Arabic (Modern Standard) |
While Arabic_TTS produces highly realistic speech, users must adhere to responsible AI practices:
Developed with ❤️ by [theBOrganization]
For inquiries, collaborations, or bug reports, please open an issue on the repository or contact us directly.