Downloads · 30 days
9
5% of all-time downloads
mahirmasud/AmarBangla-whisper
AmarBangla-whisper is a automatic speech recognition model from mahirmasud. Use it when you need speech turned into text. The card lists the license as mit.
This model is a fine-tuned version of openai/whisper-small trained on the dataset from the "Shobdotori: Where Dialects Flow into Bangla" AI Hackathon competition.
Downloads · 30 days
9
5% of all-time downloads
All-time downloads
182
Public
Parameters
242M
2.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.9 GB · 50%
From the Hugging Face model README
This model is a fine-tuned version of openai/whisper-small trained on the dataset from the "Shobdotori: Where Dialects Flow into Bangla" AI Hackathon competition.
It is designed to handle the linguistic diversity of Bangladesh, covering 20 different regional dialects with high accuracy.
0.88573The model showed strong convergence, effectively minimizing the loss over 1200 steps.
| Step | Training Loss | Validation Loss |
|---|---|---|
| 50 | 0.3669 | 0.3935 |
| 100 | 0.2040 | 0.2728 |
| 200 | 0.0678 | 0.1421 |
| 400 | 0.0055 | 0.0655 |
| 600 | 0.0033 | 0.0543 |
| 800 | 0.0026 | 0.0450 |
| 1000 | 0.0005 | 0.0440 |
| 1200 | 0.0001 | 0.0417 |
The model was trained on a diverse dataset containing audio samples from the following 20 regions of Bangladesh:
| Region 1 | Region 2 | Region 3 | Region 4 |
|---|---|---|---|
| Barisal | Bhola | Bogura | Brahmanbaria |
| Chittagong | Comilla | Dhaka | Feni |
| Jessore | Jhenaidah | Khulna | Kushtia |
| Lakshmipur | Mymensingh | Natore | Noakhali |
| Pabna | Rajshahi | Rangpur | Sylhet |
You can use this model directly with the Hugging Face pipeline or the transformers library.
pipeline (Easiest)from transformers import pipeline
# Load the pipeline
pipe = pipeline("automatic-speech-recognition", model="YOUR_USERNAME/YOUR_MODEL_NAME")
# Transcribe an audio file
transcription = pipe("path_to_audio.wav")
print(transcription["text"])
WhisperForConditionalGeneration (Custom)import librosa
import torch
from transformers import WhisperProcessor, WhisperForConditionalGeneration
# Load model and processor
model_id = "YOUR_USERNAME/YOUR_MODEL_NAME"
processor = WhisperProcessor.from_pretrained(model_id)
model = WhisperForConditionalGeneration.from_pretrained(model_id)
# Load audio (resampling to 16kHz is mandatory)
audio_path = "path_to_audio.wav"
speech_array, sr = librosa.load(audio_path, sr=16000)
# Process audio
input_features = processor(speech_array, sampling_rate=16000, return_tensors="pt").input_features
# Generate token ids
predicted_ids = model.generate(input_features)
# Decode token ids to text
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
print(transcription)
The model was trained using the following hyperparameters:
1e-0528161200450True