Views
No views yet
distil-whisper/distil-large-v3.5 optimized for transcribing Air Traffic Control (ATC) communications.distil-whisper/distil-large-v3.5| Step | Training Loss | Validation Loss | WER |
|---|---|---|---|
| 500 | 0.1131 | 0.0934 | 5.16% |
| 1000 | 0.0654 | 0.0849 | 5.72% |
| 1500 | 0.0208 | 0.0830 | 4.37% ✅ |
| 2000 | 0.0152 | 0.0859 | 4.94% |
| 2500 | 0.0080 | 0.0861 | 4.85% |
1from transformers import pipeline
2
3transcriber = pipeline(
4 task="automatic-speech-recognition",
5 model="tclin/distil-large-v3.5-atcosim-finetune",
6 torch_dtype="auto", # fp16 on GPU, fp32 on CPU
7 device="cuda" # or "cpu"
8)
9
10# The original Whisper config forces <|en|><|transcribe|> tokens and suppresses a few special-tokens. During fine-tuning, these are removed, so at inference, it is needed to unset them:
11transcriber.model.generation_config.forced_decoder_ids = None
12transcriber.model.generation_config.begin_suppress_tokens = None
13
14result = transcriber("path_to_atc_audio.wav")
15print("Transcription:", result["text"])
161import torch, torchaudio
2from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
3
4MODEL_ID = "tclin/distil-large-v3.5-atcosim-finetune"
5DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
6DTYPE = torch.float16 if torch.cuda.is_available() else torch.float32
7
8# 1. Load & pre-process audio
9audio_path = "path_to_atc_audio.wav"
10waveform, sr = torchaudio.load(audio_path) # (channels, time)
11
12# Down-mix stereo → mono
13if waveform.shape[0] > 1:
14 waveform = waveform.mean(dim=0, keepdim=True)
15
16# Resample to 16 kHz (high-quality filter)
17if sr != 16_000:
18 waveform = torchaudio.transforms.Resample(
19 sr, 16_000, lowpass_filter_width=64, rolloff=0.99,
20 resampling_method="sinc_interpolation"
21 )(waveform)
22
23audio_np = waveform.squeeze(0).numpy()
24
25# 2. Load model & processor
26processor = AutoProcessor.from_pretrained(MODEL_ID)
27model = AutoModelForSpeechSeq2Seq.from_pretrained(
28 MODEL_ID, torch_dtype=DTYPE, use_safetensors=True
29).to(DEVICE)
30
31# The original Whisper config forces <|en|><|transcribe|> tokens and suppresses a few special-tokens. During fine-tuning, these are removed, so at inference, it is needed to unset them:
32model.generation_config.forced_decoder_ids = None
33model.generation_config.begin_suppress_tokens = None
34
35# 3. Feature extraction & generation
36with torch.inference_mode():
37 inputs = processor(audio_np, sampling_rate=16_000,
38 return_tensors="pt").to(DEVICE, DTYPE)
39 ids = model.generate(**inputs, max_new_tokens=128)
40 text = processor.batch_decode(ids, skip_special_tokens=True)[0]
41
42print("✈️ Transcription:", text)@misc{ta-chun_lin_2025,
author = { Ta-Chun Lin },
title = { distil-whisper-large-v3.5-atcosim-finetune (Step 1500) },
year = 2025,
url = { https://huggingface.co/tclin/distil-whisper-large-v3.5-atcosim-finetune },
doi = { 10.57967/hf/5803 },
publisher = { Hugging Face }
}