---
title: "Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers"
description: "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."
url: "https://swe.quest/articles/fine-tune-whisper-for-multilingual-asr-with-transformers-718acb121632ac73"
canonical: "https://huggingface.co/blog/fine-tune-whisper"
source: "Hugging Face"
published: "2022-11-03"
difficulty: "medium"
kind: "How-to"
reading_minutes: 25
tags: ["speech-audio","model-training","python"]
---

# Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2022-11-03, 25 min read, How-to. Original: [https://huggingface.co/blog/fine-tune-whisper](https://huggingface.co/blog/fine-tune-whisper)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Speech & audio](https://swe.quest/tags/speech-audio.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Python and PyTorch basics ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- Transformer encoder-decoder models
- Hugging Face Transformers

## Keywords

Whisper, Hugging Face Transformers, Common Voice, Wav2Vec 2.0, Gradio, WER

## Related posts

- [Fine-Tune W2V2-Bert for low-resource ASR with 🤗 Transformers](https://swe.quest/articles/fine-tune-w2v2-bert-for-low-resource-asr-with-transformers-c92730274dccb3a7.md): Hugging Face · 2024-01-19 · Medium · 26 min read · Speech & audio, Model training, Python
  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.
- [Fine-Tune Wav2Vec2 for English ASR in Hugging Face with 🤗 Transformers](https://swe.quest/articles/fine-tune-wav2vec2-for-english-asr-in-hugging-face-with-transformers-3965ec4df26fb19a.md): Hugging Face · 2021-03-12 · Medium · 24 min read · Speech & audio, Model training, Python
  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.
- [Fine-Tune XLSR-Wav2Vec2 for low-resource ASR with 🤗 Transformers](https://swe.quest/articles/fine-tune-xlsr-wav2vec2-for-low-resource-asr-with-transformers-67aead681013ec16.md): Hugging Face · 2021-11-15 · Medium · 23 min read · Speech & audio, Model training, Python
  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).
- [Speculative Decoding for 2x Faster Whisper Inference](https://swe.quest/articles/speculative-decoding-for-2x-faster-whisper-inference-c8681e4ac958e48b.md): Hugging Face · 2023-12-20 · Medium · 12 min read · Speech & audio, Inference & serving, Performance engineering, Python
  Speculative decoding speeds up Whisper transcription by about 2x while producing mathematically identical outputs.
- [Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints](https://swe.quest/articles/powerful-asr-diarization-speculative-decoding-with-hugging-face-inference-ed388c1f3bfe4f4b.md): Hugging Face · 2024-05-01 · Medium · 7 min read · Speech & audio, Inference & serving, Python
  A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
