Downloads · 30 days
873
4% of all-time downloads
IbrahimSalah/Arabic-TTS-Spark
Arabic-TTS-Spark is a text-to-speech model from IbrahimSalah. Use it when you need text read aloud. The card lists the license as fair-noncommercial-research-license.
Arabic text-to-speech model fine-tuned on 300 hours of clean Arabic audio data. Delivers consistent, high-quality speech synthesis for Modern Standard Arabic with full diacritization.
Downloads · 30 days
873
4% of all-time downloads
All-time downloads
20.2K
Public
Repo size
2.9 GB
Likes
30
Public
Click a slice to open those files.
.safetensors1.6 GB · 56%
From the Hugging Face model README
Arabic text-to-speech model fine-tuned on 300 hours of clean Arabic audio data. Delivers consistent, high-quality speech synthesis for Modern Standard Arabic with full diacritization.
Training Data: ~300 hours of clean Arabic audio
Language: Modern Standard Arabic (MSA)
Sample Rate: 24kHz
see the Colab notebook. HF space : Arabic Spark TTS Space.
from transformers import AutoProcessor, AutoModel
import soundfile as sf
import torch
# Load model
model_id = "IbrahimSalah/Arabic-TTS-Spark"
device = "cuda" if torch.cuda.is_available() else "cpu"
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
model = AutoModel.from_pretrained(model_id, trust_remote_code=True).eval().to(device)
# Prepare inputs
inputs = processor(
text="YOUR_TEXT_WITH_TASHKEEL",
prompt_speech_path="path/to/reference.wav",
prompt_text="REFERENCE_TEXT_WITH_TASHKEEL",
return_tensors="pt"
).to(device)
# Generate
with torch.no_grad():
output_ids = model.generate(**inputs, max_new_tokens=8000, temperature=0.8)
# Decode
output = processor.decode(generated_ids=output_ids)
sf.write("output.wav", output["audio"], output["sampling_rate"])
Critical: Text must include full Arabic diacritization (tashkeel). The model is trained exclusively on fully diacritized text and will not perform well on non-diacritized input.
Example of correct input:
إِنَّ الْعِلْمَ نُورٌ يُقْذَفُ فِي الْقَلْبِ
tts.generate_long_text(
text=your_text,
prompt_audio_path="reference.wav",
prompt_transcript="reference_text",
output_path="output.wav",
max_chunk_length=300, # Characters per chunk
crossfade_duration=0.08, # Crossfade duration in seconds
normalize_audio_flag=True,
remove_silence_flag=True,
temperature=0.8, # Generation randomness
top_p=0.95, # Nucleus sampling
top_k=50 # Top-k sampling
)
Text: "إِنَّ الدَّوْلَةَ لَهَا أَعْمَارٌ طَبِيعِيَّةٌ كَمَا لِلْأَشْخَاصِ. وَأَنَّهَا تَنْتَقِلُ فِي أَطْوَارٍ مُخْتَلِفَةٍ، فَيَكُونُ الْجِيلُ الْأَوَّلُ مِنْ أَهْلِ الدَّوْلَةِ، قَدْ حَافَظُوا عَلَى الْخُشُونَةِ الْبَدَوِيَّةِ، وَالتَّوَحُّشِ، وَالشَّظَفِ، وَالْبَأْسِ، وَالِاشْتِرَاكِ فِي الْمَجْدِ. فَتَكُونُ حُدُودُهُمْ مَرْهُوبَةً، وَجَوَانِبُهُمْ مُعَزَّزَةً. ثُمَّ يَأْتِي الْجِيلُ الثَّانِي، فَيَتَحَوَّلُ حَالُهُمْ بِالْمُلْكِ وَالتَّرَفِ مِنَ الْبَدَاوَةِ إِلَى الْحَضَارَةِ، وَمِنَ الْخُشُونَةِ إِلَى التَّرَفِ. فَيَنْكَسِرُ سَوْرَةُ الْعَصَبِيَّةِ قَلِيلًا. ثُمَّ يَأْتِي الْجِيلُ الثَّالِثُ، فَيَكُونُونَ قَدْ نَسُوا عَهْدَ الْبَدَاوَةِ وَالْخُشُونَةِ، وَيَنْغَمِسُونَ فِي النَّعِيمِ وَالتَّرَفِ، وَيَصِيرُونَ عِيَالًا عَلَى الدَّوْلَةِ. فَيَسْقُطُونَ فِي الْهَرَمِ وَالزَّوَالِ، وَيَحْتَاجُونَ إِلَى مَنْ يُدَافِعُ عَنْهُمْ، فَتَبْدَأُ الدَّوْلَةُ فِي الِانْقِرَاضِ."
<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/645098004f731658826cfe57/FCGgeIu1F89rvNI55aVIx.wav"></audio>
<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/645098004f731658826cfe57/cA9Z77_P0Rm2-hu1eosOC.wav"></audio>
The model can be further fine-tuned for:
Fine-tuning infrastructure: Spark-TTS Fine-tune
This model is released under a Non-Commercial License.