lilgoose7777/slr-combined-nepali-tts2
Viewer • Updated • 177k • 78
How to use milanakdj/whisper-medium-nepali-final with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("automatic-speech-recognition", model="milanakdj/whisper-medium-nepali-final") # Load model directly
from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
processor = AutoProcessor.from_pretrained("milanakdj/whisper-medium-nepali-final")
model = AutoModelForSpeechSeq2Seq.from_pretrained("milanakdj/whisper-medium-nepali-final", device_map="auto")Nepali fine-tune of openai/whisper-medium for transcribe.
| Metric | Value |
|---|---|
| Test WER | 10.86% |
| Test CER | 3.93% |
| Best eval WER | 10.75% |
| Steps trained | 26550 |
| Parameter | Value |
|---|---|
| Base model | openai/whisper-medium |
| Language / task | nepali / transcribe |
| Epochs | 3 |
| Learning rate | 1e-05 |
| LR schedule | linear with 5% warmup ratio |
| Per-device train batch | 4 |
| Grad accumulation steps | 4 |
| Effective batch size | 16 |
| Per-device eval batch | 4 |
| Precision | bf16 |
| Gradient checkpointing | False |
| Optimizer | OptimizerNames.ADAMW_BNB |
| Weight decay | 0.0 |
| Max grad norm | 1.0 |
| Max label length | 448 tokens |
| Generation max length | 225 |
| Eval / save strategy | per epoch (best model by WER kept) |
| Seed | 42 |
| Parameter | Value |
|---|---|
| Dataset | lilgoose7777/slr-combined-nepali-tts2 |
| Rows requested | 177000 |
| Split | 80% / 10% / 10% (train/val/test) |
| Train / val / test examples | 141600 / 17700 / 17700 |
| Per-epoch validation subset | 2000 (test metrics use the full test split) |
| Audio sampling rate | 16 kHz mono |
| Checkpoint backups | milanakdj/whisper-medium-nepali-checkpoints |
The training corpus is clean single-speaker studio audio, so expect degraded accuracy on noisy real-world recordings with background noise, multiple speakers, or strong accents.
import torch
from transformers import WhisperForConditionalGeneration, WhisperProcessor
model_id = "milanakdj/whisper-medium-nepali-final"
device = "cuda" if torch.cuda.is_available() else "cpu"
processor = WhisperProcessor.from_pretrained(model_id, language="nepali", task="transcribe")
model = WhisperForConditionalGeneration.from_pretrained(model_id).to(device)
# audio: 1-D float32 numpy array at 16kHz
inputs = processor(audio, sampling_rate=16000, return_tensors="pt").to(device)
with torch.inference_mode():
ids = model.generate(inputs.input_features, max_new_tokens=225)
print(processor.batch_decode(ids, skip_special_tokens=True)[0])
Base model
openai/whisper-medium