Read-prose preserved within +6 pp WER on FLEURS-Te (0.39 vs vasista22 0.33), tied on IndicVoices conversational, +1 pp on Common Voice 25.
1from transformers import WhisperForConditionalGeneration, WhisperProcessor
2from peft import PeftModel
3
4base_model = "vasista22/whisper-telugu-large-v2"
5processor = WhisperProcessor.from_pretrained(base_model, language="telugu", task="transcribe")
6model = WhisperForConditionalGeneration.from_pretrained(base_model, torch_dtype="bfloat16").to("cuda")
7
8# vasista22's saved generation_config requires explicit forced_decoder_ids under transformers >=4.40
9forced = processor.tokenizer.get_decoder_prompt_ids(language="telugu", task="transcribe")
10model.config.forced_decoder_ids = forced
11model.generation_config.forced_decoder_ids = forced
12model.generation_config.suppress_tokens = []
13
14model = PeftModel.from_pretrained(model, "Praxel/praxy-stt-te-rb")
15model.eval()
16
17# Transcribe
18import librosa
19audio, _ = librosa.load("path/to/audio.wav", sr=16000, mono=True)
20feats = processor.feature_extractor(audio, sampling_rate=16000, return_tensors="pt").input_features.to("cuda", dtype=torch.bfloat16)
21pred_ids = model.generate(feats, max_new_tokens=400, num_beams=1)
22text = processor.tokenizer.decode(pred_ids[0], skip_special_tokens=True).strip()
23print(text)
Apache-2.0 (matches upstream vasista22 license).
1@misc{praxy_stt_2026,
2 author = {Menta, Venkata Pushpak Teja},
3 title = {The TTS--STT Flywheel: Synthetic Entity-Dense Audio Closes the Indic ASR Gap Where Commercial and Open-Source Systems Fail},
4 year = {2026},
5 publisher = {Praxel Ventures},
6 howpublished = {\url{https://huggingface.co/Praxel/praxy-stt-te-rb}},
7}