Downloads · 30 days
213
53% of all-time downloads
Tanmoyshome/bn-parler-tts
bn-parler-tts is a text-to-speech model from Tanmoyshome. Use it when you need text read aloud. It is set up for transformers. The card lists the license as apache-2.0.
Bangla (Bengali) text-to-speech model, fine-tuned from ai4bharat/indic-parler-tts on a curated, quality-filtered subset of the SUBAK.KO Bangla speech corpus. Like the base model, it generates speech conditioned on a t…
Downloads · 30 days
213
53% of all-time downloads
All-time downloads
401
Public
Parameters
938M
3.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.8 GB · 100%
From the Hugging Face model README
Bangla (Bengali) text-to-speech model, fine-tuned from
ai4bharat/indic-parler-tts on a curated,
quality-filtered subset of the SUBAK.KO Bangla speech corpus. Like the base
model, it generates speech conditioned on a text prompt (what to say, in
Bangla) and a natural-language description (how to say it: gender, pace,
clarity).
The training set was built by curating SUBAK.KO (an ASR corpus) into a TTS-suitable dataset:
ai4bharat/indic-parler-tts (text encoder frozen; decoder + LM head trained)Using Parler-TTS is as simple as "Bengali". Simply install the library once:
pip install git+https://github.com/huggingface/parler-tts.git
import torch
from parler_tts import ParlerTTSForConditionalGeneration
from transformers import AutoTokenizer
import soundfile as sf
device = "cuda:0" if torch.cuda.is_available() else "cpu"
model = ParlerTTSForConditionalGeneration.from_pretrained("Tanmoyshome/bn-parler-tts").to(device)
tokenizer = AutoTokenizer.from_pretrained("Tanmoyshome/bn-parler-tts")
description_tokenizer = AutoTokenizer.from_pretrained(model.config.text_encoder._name_or_path)
prompt = "রোগ যদি ধরতে চাও রোগীর ইতিহাস জেনে নাও তাতে কিছু তথ্য নাও সেই মত পথ্য দাও"
description = ("A Bengali female speaker speaks at a moderate pace "
"in a very clear environment.")
description_input_ids = description_tokenizer(description, return_tensors="pt").to(device)
prompt_input_ids = tokenizer(prompt, return_tensors="pt").to(device)
generation = model.generate(
input_ids=description_input_ids.input_ids,
attention_mask=description_input_ids.attention_mask,
prompt_input_ids=prompt_input_ids.input_ids,
prompt_attention_mask=prompt_input_ids.attention_mask,
)
audio_arr = generation.cpu().numpy().squeeze()
sf.write("bn_tts_out.wav", audio_arr, model.config.sampling_rate)
Requires pip install git+https://github.com/huggingface/parler-tts.git soundfile.
Descriptions in training follow a fixed attribute style; you will get the most reliable control by mirroring it:
Fine-tuned from ai4bharat/indic-parler-tts
(AI4Bharat), built on the Parler-TTS architecture. Please also refer to the
base model card for architecture details and broader usage guidance.