How to use from the
Use from the
PEFT library
Task type is invalid.

Whisper Large V3 Code-Switch LoRA

A PEFT LoRA adapter for automatic speech recognition on code-switched speech. It was trained on Hindi–English and Bengali data with OpenAI Whisper Large V3 as the base. Load the adapter alongside that base checkpoint.

The release contains the final adapter from version 2 of the training run, saved after step 1,524. Training used LoRA rank 16, alpha 32, dropout 0.05, and the query and value projections as targets. The training job's built-in evaluation hit an FP16 input dtype mismatch after the final weights were saved. The scores below come from a separate CPU evaluation of those saved weights.

Usage

Install PyTorch, transformers==4.51.3, peft==0.15.2, and soundfile. The example expects a mono, 16 kHz WAV of up to 30 seconds. Authenticate with Hugging Face to access the private adapter.

import soundfile as sf
import torch
from peft import PeftModel
from transformers import WhisperForConditionalGeneration, WhisperProcessor

base_id = "openai/whisper-large-v3"
adapter_id = "GL3MON/whisper-large-v3-code-switch-lora"

processor = WhisperProcessor.from_pretrained(base_id)
base = WhisperForConditionalGeneration.from_pretrained(base_id, torch_dtype=torch.float32)
model = PeftModel.from_pretrained(base, adapter_id).eval()

audio, rate = sf.read("utterance.wav", dtype="float32")
if rate != 16_000 or audio.ndim != 1 or not 0 < len(audio) <= 30 * rate:
    raise ValueError("Use a mono 16 kHz WAV of up to 30 seconds")

features = processor.feature_extractor(
    audio, sampling_rate=rate, return_tensors="pt", return_attention_mask=True
)
with torch.inference_mode():
    tokens = model.generate(
        **features, language="hi", task="transcribe",
        num_beams=1, do_sample=False, max_new_tokens=128,
    )
print(processor.batch_decode(tokens, skip_special_tokens=True)[0])

Training data

Source Training clips Held back during training
MUCS Hinglish 512 24
Hinglish Casual 512 0
Noisy Hinglish ASR 419 24
Bangali Local Dialect ASR 140 24
Total 1,583 72

Source dataset cards document collection methods and terms. MUCS Hinglish · Hinglish Casual · Noisy Hinglish ASR · Bangali Local Dialect ASR

Independent evaluation

The sample contains 21 clips from 21 speakers in the official MUCS Hinglish test split, covering 166.3 seconds and 305 reference words. Starting at each 150th row, the evaluation selected the first clip among the next 24 rows with 6–32 reference words and both English and Devanagari words. Both models used CPU BF16, a Hindi language hint, greedy decoding, and up to 128 new tokens. Scoring applied Unicode NFC, case folding, punctuation replacement with spaces, and whitespace normalization while preserving script and diacritics. MUCS Hinglish dataset

Metric Base Whisper Large V3 With LoRA Change
Word error rate 60.00% 45.57% −14.43 percentage points
Character error rate 48.41% 33.46% −14.95 percentage points
Word errors 183 139 −44

GGML for whisper.cpp

The ggml/ggml-large-v3-code-switch-q5_0-mixed.bin file merges the LoRA weights into Whisper Large V3 and quantizes the full model to Q5_0 for whisper.cpp. It is 1.08 GB. Use it as the model file (-m) with whisper.cpp. Calibration used 16 clips selected by replaying the original training-source sampler and 16 IndicVoices clips. Activation importance weights were applied to 512 linear tensors. IndicVoices

The same 21 MUCS Hinglish test clips were evaluated against the reference transcripts using CPU whisper.cpp, matched decoding, and Silero VAD. MUCS Hinglish

GGML Q5_0 variant WER CER
Standard 59.02% 45.73%
IndicVoices calibration 58.03% 45.05%
Training-source and IndicVoices calibration 58.36% 44.98%

A training-source transcript matched a test reference and was excluded from calibration. Excluding that clip from scoring preserved the WER ranking. The training run did not export its complete manifest, so other overlap with the original fine-tuning data remains possible.

SHA-256: 6806e7a9ee63aaa1930dd329812863335fe623295572d68888cbc5b9574e24c5.

Intended use and limitations

Use this adapter as an experimental checkpoint for Hindi–English ASR. The benchmark is a small sample of lecture speech, so performance may differ on spontaneous conversations, noisy calls, or other domains. The evaluation covers Hindi–English only. Bengali quality and deployment latency remain unmeasured. WER and CER are script-sensitive, including when a correct-sounding word is written in a different script.

Downloads last month
25
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for GL3MON/whisper-large-v3-code-switch-lora

Adapter
(254)
this model

Datasets used to train GL3MON/whisper-large-v3-code-switch-lora

Evaluation results