Balochi-TTS-Three-Speakers

Balochi Latin-script text-to-speech with three speaker voices, built with SpeechT5.

Speakers

Voice Key Embedding file Description
Ayn Káder ayn_kader speaker_embedding_ayn_kader.pt Original news reader
Dódá doda speaker_embedding_doda.pt Male voice
Dódén doden speaker_embedding_doden.pt Female voice

Quick start

import torch
import soundfile as sf
from huggingface_hub import hf_hub_download
from transformers import SpeechT5ForTextToSpeech, SpeechT5HifiGan, SpeechT5Processor

MODEL_ID = "Aynkader/Balochi-TTS-Three-Speakers"
device = "cuda" if torch.cuda.is_available() else "cpu"

processor = SpeechT5Processor.from_pretrained(MODEL_ID)
model = SpeechT5ForTextToSpeech.from_pretrained(MODEL_ID).to(device).eval()
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan").to(device).eval()

emb_path = hf_hub_download(MODEL_ID, "speaker_embedding_ayn_kader.pt")
speaker = torch.load(emb_path, map_location="cpu", weights_only=False)
if speaker.dim() == 1:
    speaker = speaker.unsqueeze(0)

text = "Gwáderá tyáb dapá sharábay proshtagén bótalán daryáward paréshán kotagant."
inputs = processor(text=text, return_tensors="pt").to(device)

with torch.no_grad():
    speech = model.generate_speech(
        inputs["input_ids"],
        speaker.to(device),
        vocoder=vocoder,
        threshold=0.62,
        minlenratio=0.10,
        maxlenratio=6.0,
    )

sf.write("output.wav", speech.cpu().numpy(), 16000)

Supported text

Use Balochi Latin characters:

a b c d e g h i j k l m n o p r s t u w y z
á é ó  (and uppercase)
. , : ? ! ' -
digits 0-9

Arabic script input is supported in the web Space via built-in Arabic → Latin conversion.

Model files

File Description
config.json SpeechT5 architecture
model.safetensors Fine-tuned weights (~578 MB)
preprocessor_config.json Mel spectrogram settings
spm_char.model SentencePiece tokenizer
speaker_embedding_ayn_kader.pt News reader embedding
speaker_embedding_doda.pt Male speaker embedding
speaker_embedding_doden.pt Female speaker embedding

Training

  1. Base: BalochiT5-Fine-Tuned-Model2-News (25 news clips)
  2. Three-speaker fine-tune: 75 samples (Ayn Káder, Dódá, Dódén)
  3. Per-file speaker embeddings (x-vector)
  4. Script: train_tts_three_speakers.py in the upstream TTS project

Limitations

  • Best for short paragraphs (≤100 characters recommended)
  • Latin script input for direct inference; Arabic via converter
  • Requires internet on first run for HiFi-GAN vocoder
  • Small per-speaker dataset (25 clips each)

Citation

Aynkader/Balochi-TTS-Three-Speakers — https://huggingface.co/Aynkader/Balochi-TTS-Three-Speakers

License

Apache 2.0

Downloads last month
71
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support