Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 24 min read How-to mediumAdept

Fine-Tune Wav2Vec2 for English ASR in Hugging Face with πŸ€— Transformers

Wav2Vec2, pretrained with a contrastive masked objective on 50k+ hours of unlabeled speech, can be fine-tuned with CTC on small labeled datasets for end-to-end English ASR without a language model. The walkthrough fine-tunes the base checkpoint on the 5-hour Timit corpus using πŸ€— Transformers and Datasets. It covers building a character-level CTC vocabulary (lowercasing, stripping punctuation, keeping apostrophes, mapping space to a word delimiter, and adding UNK and PAD/blank tokens), and configuring the feature extractor with a matching 16kHz sampling rate and normalization. It also explains why the base checkpoint works better without an attention mask, and evaluates with WER via jiwer while pushing checkpoints to the Hub.

Assumes: PyTorch basicsTransformer modelsCTC loss basics

Related posts

  • Fine-Tune Whisper For Multilingual ASR with πŸ€— Transformers

    Hugging Face mediumAdept

    Whisper, OpenAI's encoder-decoder ASR model pre-trained on 680,000 hours of labelled audio, can be fine-tuned for a low-resource language with Hugging Face Transformers using only about 8 hours of data. The walkthrough fine-tunes the multilingual small checkpoint (244M params) on Hindi from Common Voice 11. It covers loading and trimming the dataset, then preparing data with WhisperFeatureExtractor, which resamples to 16kHz, pads or truncates to 30s and converts audio to log-Mel spectrograms, plus WhisperTokenizer. It then moves through training and WER evaluation and ends with a Gradio demo. Along the way it explains why supervised pre-training needs less fine-tuning than Wav2Vec 2.0 and why Whisper needs no attention mask.

  • Fine-Tune W2V2-Bert for low-resource ASR with πŸ€— Transformers

    Hugging Face mediumAdept

    Wav2Vec2-BERT (facebook/w2v-bert-2.0), a 580M-parameter audio model pre-trained on 4.5M hours across 143+ languages, can be fine-tuned with CTC for ASR in low-resource languages using Hugging Face Transformers, demonstrated on ~14h of Mongolian Common Voice 16.0 data. The walkthrough covers text normalization, building a character vocabulary (dropping Latin characters and punctuation), the Wav2Vec2CTCTokenizer and SeamlessM4TFeatureExtractor, training, and tips for scaling CTC training. Compared with Whisper-large-v3 after similar fine-tuning, it reaches similar WER on Mongolian while running 10-30x faster and being 2.5x more resource-efficient, because it decodes in a single non-autoregressive pass and adapts to any alphabet.

  • Fine-Tune XLSR-Wav2Vec2 for low-resource ASR with πŸ€— Transformers

    Hugging Face mediumAdept

    XLS-R, the multilingual successor to Wav2Vec2 pre-trained on roughly half a million hours of audio in 128 languages, can be fine-tuned for speech recognition by adding a linear layer on top and training with Connectionist Temporal Classification (CTC). The walkthrough fine-tunes the 300M-parameter checkpoint on about 4 hours of Turkish Common Voice data using πŸ€— Transformers and Datasets. It covers text normalization (stripping punctuation, lowercasing, replacing hatted characters), building a character-level vocabulary with word-delimiter, unknown and CTC blank/padding tokens, and setting up the Wav2Vec2CTCTokenizer and feature extractor, with word error rate as the evaluation metric.

  • Open ASR Leaderboard: Trends and Insights with New Multilingual & Long-Form Tracks

    Hugging Face easyNovice

    Across 60+ open and closed ASR models on 11 datasets, Conformer encoders paired with LLM decoders (Canary-Qwen-2.5B, Granite-Speech-3.3-8B, Phi-4-Multimodal) achieve the lowest English word error rates. CTC and TDT decoders run 10–100Γ— faster (higher RTFx) at slightly worse accuracy, which suits batch and long-form work. Multilingual coverage tends to cost single-language accuracy, as with Whisper Large v3 versus English-tuned variants and MMS versus language-specific encoders. On the new long-form track, closed systems still lead, and Parakeet CTC 1.1B reaches RTFx 2793.75 against Whisper Large v3's 68.56 with WER of 6.68 versus 6.43, though that Parakeet version is English-only.

  • Speculative Decoding for 2x Faster Whisper Inference

    Hugging Face mediumAdept

    Speculative decoding speeds up Whisper transcription by about 2x while producing mathematically identical outputs. A fast assistant model drafts candidate tokens and the main model verifies them in a single forward pass. With Distil-Whisper (full encoder, 2 decoder layers) as assistant to Whisper large-v2, a 73-sample LibriSpeech benchmark dropped from 73s to 33s at the same 3.5% WER, with only about 8% extra VRAM from sharing the encoder. For multilingual use, a multilingual checkpoint such as Whisper tiny can serve as assistant, since the only hard constraint is an identical tokenizer. Note that large-v3's expanded vocabulary makes it incompatible with older checkpoints.

The quest for software engineering knowledge.

Look:
Layout: