Views
No views yet
<|yo|> (id 50325) as a language-token proxy, at both training and inference. Supply the forced decoder prefix shown below.1import numpy as np, torch
2from transformers import WhisperProcessor, WhisperForConditionalGeneration
3
4processor = WhisperProcessor.from_pretrained("openai/whisper-small")
5model = WhisperForConditionalGeneration.from_pretrained("theelvace/whisper-small-igbo-25k").eval()
6model.config.forced_decoder_ids = None
7
8# audio: 16 kHz mono float32 numpy array
9feats = processor.feature_extractor(audio, sampling_rate=16000, return_tensors="pt").input_features
10ids = model.generate(
11 feats,
12 forced_decoder_ids=[[1, 50325], [2, 50359], [3, 50363]], # <|yo|>, transcribe, no-timestamps
13 num_beams=5,
14 max_new_tokens=100,
15)
16print(processor.tokenizer.decode(ids[0], skip_special_tokens=True))openai/whisper-small, warm-started from a LoRA adapter (q/v, r=32) that reached 62.45% WER, then full fine-tuned (all parameters — same on-device size as the base).theelvace/whisper-small-igbo (62.45% WER) is not subject to the non-commercial restriction.