Downloads · 30 days
36
18% of all-time downloads
hlasith/whisper-sinhala-small
whisper-sinhala-small is a automatic speech recognition model from hlasith. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as other.
A fine-tuned Whisper-small model for Sinhala (සිංහල) speech recognition. This model significantly improves transcription quality for Sinhala language audio compared to the base openai/whisper-small model, which has no…
Downloads · 30 days
36
18% of all-time downloads
All-time downloads
205
Public
Parameters
242M
967 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors967 MB · 100%
From the Hugging Face model README
A fine-tuned Whisper-small model for Sinhala (සිංහල) speech recognition. This model significantly improves transcription quality for Sinhala language audio compared to the base openai/whisper-small model, which has no native Sinhala support.
| Metric | Base whisper-small | Fine-tuned | Improvement |
|---|---|---|---|
| WER (Word Error Rate) | 130.86% | 61.73% | −69.13 pp (45% relative) |
| CER (Character Error Rate) | 244.38% | 14.86% | −229.52 pp (94% relative) |
Evaluated on 10 validation audio samples from the Sinhala speech corpus.
The base Whisper-small model was not trained on Sinhala and produces unusable output — mixing Greek, Telugu, Tamil, Arabic, and Hindi characters with English phrases on Sinhala audio. Fine-tuning transforms this into meaningful Sinhala transcription.
Example (Sinhala song vocals, ~4.7 min):
| Transcript | |
|---|---|
| Base whisper-small | ὁ ὁ ὁ ... వార్ల్ల్ల్ ... I'm running, running, running ... My dear, my dear ... Thank you very much for your time ... (gibberish: Greek, Telugu, English, Arabic, Tamil) |
| Fine-tuned Sinhala | සුවදට මද නළයි විසික්කල්ය සිවදට මද නළයි විසික්කල්ය ... සමුදුරුරපටු පොල රැලින්යේ ... හාමෝයේ වෝපේ ... (readable Sinhala with correct phonetic patterns) |
| Property | Value |
|---|---|
| Base model | openai/whisper-small |
| Architecture | WhisperForConditionalGeneration |
| Parameters | ~244M (12 encoder, 12 decoder, d_model=768) |
| Language | Sinhala (si-LK) |
| Task | Automatic Speech Recognition (transcription) |
| Training steps | 5,000 |
| Learning rate | 1e-4 |
| Batch size | 2 (per device), gradient accumulation: 4 |
| Precision | FP32 (for MPS/CUDA compatibility) |
Fine-tuned on the Sinhala speech corpus (audio_data/si_lk.lines.txt):
( audio_id "transcript" ) per linefrom transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
import torch
model_id = "harshanaDisa/whisper-sinhala-small"
device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float32
model = AutoModelForSpeechSeq2Seq.from_pretrained(
model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)
pipe = pipeline(
"automatic-speech-recognition",
model=model,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
device=device,
torch_dtype=torch_dtype,
chunk_length_s=30,
stride_length_s=5,
)
result = pipe("path/to/audio.mp3")
print(result["text"])
# Clone repo and transcribe
git clone https://github.com/harshanaDisa/whisper-sinhala.git
cd whisper-sinhala
python transcribe_vocals.py
# Install dependencies
python -m venv .venv && source .venv/bin/activate
pip install torch transformers accelerate soundfile librosa jiwer datasets pandas
# Prepare dataset
python create_samples.py
# Train
python train.py
# Evaluate (fine-tuned only)
python test_model.py
# Compare against base whisper-small
python test_model.py --compare
50363) for cleaner transcription outputThe full training code, dataset preparation scripts, and evaluation pipeline are available in the GitHub repository.
This model is released for research and educational purposes. The base Whisper architecture is by OpenAI; the fine-tuned weights are derived from openai/whisper-small.
@inproceedings{radford2022whisper,
title={Robust Speech Recognition via Large-Scale Weak Supervision},
author={Radford, Alec and others},
booktitle={ICML},
year={2023}
}