Downloads · 30 days
10
4% of all-time downloads
vanshnawander/whisper-small-hindi-asr
whisper-small-hindi-asr is a automatic speech recognition model from vanshnawander. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as apache-2.0.
This is a fine-tuned version of openai/whisper-small for Hindi automatic speech recognition (ASR).
Downloads · 30 days
10
4% of all-time downloads
All-time downloads
273
Public
Parameters
242M
967 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors967 MB · 99%
From the Hugging Face model README
This is a fine-tuned version of openai/whisper-small for Hindi automatic speech recognition (ASR).
Evaluated on the LAHAJA benchmark - a multi-accent Hindi ASR benchmark with 12.5 hours of audio from 132 speakers across 83 districts of India.
| Model | WER | CER | Improvement |
|---|---|---|---|
| Base (whisper-small) | 145.67% | 101.57% | - |
| This Model | 36.17% | 11.36% | 75.2% |
from transformers import WhisperProcessor, WhisperForConditionalGeneration
import librosa
# Load model and processor
processor = WhisperProcessor.from_pretrained("vanshnawander/whisper-small-hindi-asr")
model = WhisperForConditionalGeneration.from_pretrained("vanshnawander/whisper-small-hindi-asr")
# Load audio
audio, sr = librosa.load("audio.wav", sr=16000)
# Transcribe
input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features
generated_ids = model.generate(input_features, language="hi", task="transcribe")
transcription = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(transcription)
from transformers import pipeline
pipe = pipeline(
"automatic-speech-recognition",
model="vanshnawander/whisper-small-hindi-asr",
chunk_length_s=30,
)
result = pipe("audio.wav", generate_kwargs={"language": "hi", "task": "transcribe"})
print(result["text"])