Downloads · 30 days
11
4% of all-time downloads
adoamesh/whisper-small-swh-finetuned
whisper-small-swh-finetuned is a automatic speech recognition model from adoamesh. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned version of OpenAI's Whisper-small specifically for Swahili Automatic Speech Recognition (ASR). It was fine-tuned on the Swahili portion of the FLEURS-SLU dataset to significantly improve tra…
Downloads · 30 days
11
4% of all-time downloads
All-time downloads
268
Public
Parameters
242M
967 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors967 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of OpenAI's Whisper-small specifically for Swahili Automatic Speech Recognition (ASR). It was fine-tuned on the Swahili portion of the FLEURS-SLU dataset to significantly improve transcription accuracy for the Swahili language.
swh,sw,Aswh)The fine-tuned model achieves a 68% relative improvement in Word Error Rate (WER) over the base model on the Swahili test set.
| Model | WER (%) |
|---|---|
openai/whisper-small (baseline) | 103.10 |
adoamesh/whisper-small-swh-finetuned (this model) | 32.07 |
This model is based on the openai/whisper-small architecture, which features a Transformer-based encoder-decoder structure. It has been specifically adapted for Swahili by continuing pre-training on Swahili audio data.
This model is intended for transcribing Swahili speech to text. Primary use cases include:
The model can be fine-tuned further for specific domains or accents within Swahili.
TESTED ON WINDOWS 11:
<details> <summary><b>TESTED ON WINDOWS 11: Click to expand comparison between the Whisper small vs the finetuned model: code</b></summary>import torch
import librosa
from transformers import WhisperProcessor, WhisperForConditionalGeneration
# --- 1️⃣ Load processor (shared between models) ---
processor = WhisperProcessor.from_pretrained("openai/whisper-small")
# --- 2️⃣ Load models ---
# Fine-tuned Swahili Whisper-Small from Hugging Face Hub
finetuned_model = WhisperForConditionalGeneration.from_pretrained("adoamesh/whisper-small-swh-finetuned")
finetuned_model.generation_config.language = "swahili"
finetuned_model.generation_config.task = "transcribe"
finetuned_model.eval()
# Original OpenAI Whisper-Small
original_model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
original_model.generation_config.language = "swahili"
original_model.generation_config.task = "transcribe"
original_model.eval()
# --- 3️⃣ Load audio file using librosa ---
audio_path = "Recording.wav"
try:
waveform, sample_rate = librosa.load(audio_path, sr=16000)
waveform = torch.from_numpy(waveform).float().unsqueeze(0)
except Exception as e:
print(f"Error loading audio with librosa: {e}")
exit(1)
# Prepare input features
input_features = processor(
waveform.numpy()[0],
sampling_rate=16000,
return_tensors="pt"
).input_features
# --- 4️⃣ Transcribe ---
with torch.no_grad():
# Fine-tuned
predicted_ids_finetuned = finetuned_model.generate(input_features)
transcription_finetuned = processor.batch_decode(predicted_ids_finetuned, skip_special_tokens=True)[0]
# Original
predicted_ids_original = original_model.generate(input_features)
transcription_original = processor.batch_decode(predicted_ids_original, skip_special_tokens=True)[0]
# --- 5️⃣ Print results ---
print("\n=== Transcriptions ===")
print(f"Fine-tuned Swahili Whisper-Small: {transcription_finetuned}")
print(f"Original Whisper-Small (OpenAI): {transcription_original}")
<details>
<summary><b>Transcriptions comparison between the Whisper small vs the finetuned model: code</b></summary>
Fine-tuned Swahili Whisper-Small: Ni limwambia yulebindi kwamba na mpenda.
Original Whisper-Small (OpenAI): Nili mwabi ayule bindi kwa mba nampe dha.
The model was fine-tuned on the Swahili (sw) split of the FLEURS-SLU dataset.
| Dataset Split | Duration (hours) |
|---|---|
| Training | 3.62 |
| Test | 0.60 |
| Total | 4.22 |
| Metric | Value |
|---|---|
| Final Training Loss | 0.0007 |
| Validation Loss | 0.8038 |
| Final WER | 32.07% |
| Training Runtime | ~2.3 hours |
| Total Epochs | 19.6 |
The primary metric for evaluation is Word Error Rate (WER) on the Swahili test set. The fine-tuned model shows a dramatic improvement.
| Model | WER (%) | Relative Improvement |
|---|---|---|
openai/whisper-small | 103.10 | - |
adoamesh/whisper-small-swh-finetuned | 32.07 | +68% |
Audio: "Nilimwambia yule bibi kwamba nampenda." (I told that lady that I love her.)
| Model | Transcription |
|---|---|
| Fine-tuned Model | Ni limwambia yulebindi kwamba na mpenda. |
| Base Model | Nili mwabi aiyule bindi kwa mba nampe dha. |
The fine-tuned model produces a more accurate and natural-sounding transcription.
If you use this model, please cite both the original Whisper paper and this model.
@misc{odhiambo2025whispersmallswahili,
author = {Odhiambo, Daniel Amemba},
title = {Whisper Small Swahili Fine-tuned},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/adoamesh/whisper-small-swh-finetuned}}
}
@misc{radford2022whisper,
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},
year = {2022},
eprint = {2212.04356},
archivePrefix = {arXiv},
primaryClass = {eess.AS}
}
This model card was authored by Daniel Amemba Odhiambo and redesigned with the help of an AI assistant.