Bangladeshi Bangla TTS: StyleTTS 2
StyleTTS 2 fine-tuned for Bangla from the public LibriTTS checkpoint. StyleTTS 2 is the architecture behind Kokoro-82M; Kokoro ships no training code, so this model fine-tunes StyleTTS 2 directly.
🏠 Start here: Bangladeshi Bangla TTS Hub · Collections: BanglaBox · Models · Datasets · Demos · All repos
Download
pip install -U "huggingface_hub[cli]"
huggingface-cli download EMTIAZZ/bangladeshi-bangla-tts-styletts2 --local-dir styletts2-bangla
Model details
| Property | Value |
|---|---|
| Base model | StyleTTS 2 (LibriTTS checkpoint) |
| Training script | train_finetune_accelerate.py (single GPU, fp16) |
| Text front end | espeak-ng Bangla (bn) phonemes, normalised to StyleTTS 2's 178-symbol table |
| Training data | Bangladeshi Bangla speech, single speaker |
| Audio | 24 kHz, 80-band mel, HiFi-GAN decoder |
| Language | Bangla (bn) |
Files
| File | What it is |
|---|---|
bangla_final_infer.pth |
Fine-tuned model weights |
bangla_infer.py |
Inference script |
styletts2_repo.tgz |
The patched StyleTTS 2 code used for training |
styletts2_aux.tar.gz |
Auxiliary models StyleTTS 2 needs (text aligner, pitch extractor, PL-BERT) |
adiba_ref.wav, twister_ref.wav |
Reference clips for the speaking style |
Usage
# 1. system phonemizer
sudo apt-get install -y espeak-ng # macOS: brew install espeak-ng
# 2. code, auxiliary models and Python deps
tar -xzf styletts2_repo.tgz && tar -xzf styletts2_aux.tar.gz
pip install -r StyleTTS2/requirements.txt phonemizer munch soundfile librosa
# 3. run (one sentence per line in infer_text.txt, or the built-in examples)
python bangla_infer.py bangla_final_infer.pth
bangla_infer.py was written for the training machine, so first edit the paths at the top of the script:
REF: a reference clip, for exampleadiba_ref.wavOUT_DIR: where to write the samples- the StyleTTS 2 folder, which must contain
Configs/config_bangla_ft.yml
Output is 24 kHz WAV.
How inference works
The text is phonemised with espeak-ng exactly as during training. The style diffusion module was not trained for Bangla, so the script sets alpha = beta = 0 and takes the speaking style and prosody from the reference clip instead. A short duration clamp removes noise at the end of each utterance.
Limitations
- The style diffusion module is not trained for Bangla; voice and prosody come from the reference clip.
- espeak-ng's Bangla pronunciation rules are imperfect, so rare words and names can be mispronounced.
- Single-speaker training data, so voices far from the training speaker work less well.
- Numbers, dates and abbreviations should be written out in words first.
License and responsible use
The StyleTTS 2 code is MIT-licensed. The LibriTTS base checkpoint comes with a condition: listeners must be told that speech is synthesised, unless you have permission to use the voice. Only use reference voices with the speaker's consent, do not impersonate real people, and label generated audio as synthetic.
Reproduce training
- Unpack the code and auxiliary models:
tar -xzf styletts2_repo.tgz && tar -xzf styletts2_aux.tar.gz. - Prepare your data as StyleTTS 2 expects: 24 kHz WAVs, espeak-ng
bnphonemes mapped to the 178-symbol table, andtrain_list.txt/val_list.txt. The data paths are set inConfigs/config_bangla_ft.ymlinside the code archive. - Fine-tune on one GPU from the LibriTTS checkpoint:
cd StyleTTS2 accelerate launch --mixed_precision=fp16 --num_processes=1 train_finetune_accelerate.py \ --config_path Configs/config_bangla_ft.yml - Run inference with
bangla_infer.pyas above.
Intermediate StyleTTS 2 / Kokoro checkpoints from this work are in the kokoro-* and pathA-bangla folders
of bangladeshi-bangla-tts-training-checkpoints.
Author
Emtiaz Uddin Ahmed, Dhaka, Bangladesh · Website · GitHub · Hugging Face