Downloads · 30 days
26
10% of all-time downloads
Aynkader/Balochi-TTS-Three-Speakers
Balochi-TTS-Three-Speakers is a text-to-speech model from Aynkader. Use it when you need text read aloud. It is set up for transformers. The card lists the license as apache-2.0.
Balochi Latin-script text-to-speech with three speaker voices, built with SpeechT5.
Downloads · 30 days
26
10% of all-time downloads
All-time downloads
258
Public
Parameters
144M
578 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors578 MB · 100%
From the Hugging Face model README
Balochi Latin-script text-to-speech with three speaker voices, built with SpeechT5.
Aynkader/Balochi-TTS-Three-SpeakersBalochiT5-Fine-Tuned-Model2-Newsmicrosoft/speecht5_hifiganAynkader/Balochi-TTS| 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 |
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)
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.
| 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 |
BalochiT5-Fine-Tuned-Model2-News (25 news clips)train_tts_three_speakers.py in the upstream TTS projectAynkader/Balochi-TTS-Three-Speakers — https://huggingface.co/Aynkader/Balochi-TTS-Three-Speakers
Apache 2.0