Downloads · 30 days
2
9% of all-time downloads
swayam8624/whisper-small-hi-lora
whisper-small-hi-lora is a automatic speech recognition model from swayam8624. Use it when you need speech turned into text. It is set up for peft.
This is a fine-tuned version of openai/whisper-small for Hindi automatic speech recognition, using LoRA (Low-Rank Adaptation) for parameter-efficient training.
Downloads · 30 days
2
9% of all-time downloads
All-time downloads
23
Public
Repo size
108 MB
Likes
0
Public
Click a slice to open those files.
.pt79.2 MB · 44%
From the Hugging Face model README
This is a fine-tuned version of openai/whisper-small for Hindi automatic speech recognition, using LoRA (Low-Rank Adaptation) for parameter-efficient training.
This model is a fine-tuned version of OpenAI's Whisper-small specifically for Hindi speech recognition. It was trained using LoRA (Low-Rank Adaptation) technique which allows for efficient parameter-efficient fine-tuning by only training a small subset of adapter parameters while keeping the base model frozen.
This model can be used for:
This model can be fine-tuned further for specific domains or use cases requiring Hindi speech recognition.
This model is specifically trained for Hindi and may not perform well on other languages. It is intended for general Hindi speech recognition and may not be suitable for specialized domains without additional fine-tuning.
As with all speech recognition models, this model may have biases related to:
Users should be aware of these limitations and test the model on their specific use cases. For production use, additional evaluation and possibly domain-specific fine-tuning may be required.
from transformers import WhisperProcessor, WhisperForConditionalGeneration
from peft import PeftModel
import torch
import librosa
# Load base model and processor
base_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
processor = WhisperProcessor.from_pretrained("openai/whisper-small", language="hindi", task="transcribe")
# Load LoRA adapters
model = PeftModel.from_pretrained(base_model, "swayam8264/whisper-small-hi-lora")
# Load and preprocess audio
audio, sampling_rate = librosa.load("path/to/hindi/audio.wav", sr=16000)
input_features = processor(audio, sampling_rate=sampling_rate, return_tensors="pt").input_features
# Generate transcription
with torch.no_grad():
predicted_ids = model.generate(input_features)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
print(transcription[0])
The model was trained on approximately 10 hours of Hindi audio data from various sources. The training dataset includes:
The model was evaluated on the FLEURS Hindi test set, which provides a standardized benchmark for multilingual speech recognition.
| Model | WER (%) | Improvement |
|---|---|---|
| Baseline (Pretrained) | 74.14 | — |
| Fine-tuned (LoRA) | 68.12 | 6.02% |
The fine-tuned model shows a 6.02% absolute improvement in WER over the baseline pretrained model on the FLEURS Hindi test set.
This model uses the Whisper architecture with LoRA adapters for efficient fine-tuning. The objective is to minimize the cross-entropy loss between predicted and actual token sequences.
BibTeX:
@article{radford2022robust,
title={Robust speech recognition via large-scale weak supervision},
author={Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
journal={arXiv preprint arXiv:2212.04356},
year={2022}
}
APA: Radford, A., Kim, J. W., Xu, T., Brockman, G., McLeavey, C., & Sutskever, I. (2022). Robust speech recognition via large-scale weak supervision. arXiv preprint arXiv:2212.04356.
Swayam Singal
For questions or issues, please contact swayam8264 on Hugging Face.