Whisper Small - Libyan Arabic (Fine-Tuned & Merged)

This model is a fine-tuned version of OpenAI Whisper Small specifically optimized for Automatic Speech Recognition (ASR) in Libyan Arabic dialect.

The model was trained using LoRA (Low-Rank Adaptation) and subsequently merged with the base model weights (Merge & Unload). This allows for standalone deployment and efficient inference without requiring additional adapter loading.


Model Details

  • Developer: Tasneem Sheeha (Tass02)
  • Base Model: openai/whisper-small
  • Task: Automatic Speech Recognition (ASR)
  • Language/Dialect: Arabic (Libyan Dialect)
  • License: Apache 2.0

Training Data and Metrics

  • Total Samples: 5,357 audio samples
  • Dataset Split: 4,821 training samples / 536 evaluation samples
  • Training Loss: 0.6256
  • Validation Loss: 0.8841

Usage

You can load and run this model using Python with transformers, torch, and librosa:

import torch
import librosa
from transformers import WhisperProcessor, WhisperForConditionalGeneration

# 1. Load model and processor from Hugging Face Hub
model_id = "Tass02/whisper-small-libyan"
processor = WhisperProcessor.from_pretrained(model_id)
model = WhisperForConditionalGeneration.from_pretrained(model_id).to("cuda")
model.eval()

# 2. Transcription function
def transcribe_audio(audio_file_path):
    audio_array, _ = librosa.load(audio_file_path, sr=16000)
    input_features = processor(audio_array, sampling_rate=16000, return_tensors="pt").input_features.to("cuda")
    
    with torch.no_grad():
        generated_ids = model.generate(
            input_features,
            language="arabic",
            task="transcribe",
            no_repeat_ngram_size=3,
            repetition_penalty=1.1,
            num_beams=5,
            max_new_tokens=225
        )
    
    return processor.batch_decode(generated_ids, skip_special_tokens=True)[0]

# 3. Example usage
transcription = transcribe_audio("path_to_audio.mp3")
print("Transcription:", transcription)
Downloads last month
20
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Tass02/whisper-small-libyan

Finetuned
(3763)
this model