← All posts
April 18, 20242 min read

Speech-to-Text with Whisper

Installing OpenAI's Whisper and picking the right model size for the VRAM you actually have.

#ml#whisper#audio

Usage

  • Install Miniconda and CUDA locally, or just run it on a GPU via Kaggle/Colab.
  • Install ffmpeg.
  • Install Whisper straight from GitHub:
pip install git+https://github.com/openai/whisper.git

To update an existing installation:

pip install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git

Run it:

whisper audio.ext --language English --model large -o OutputFolder

For English audio, the .en variants (medium.en, small.en, tiny.en) outperform their multilingual counterparts of the same size.

Useful CLI flags:

# force a language, skipping auto-detection
whisper audio.mp3 --language en
 
# limit output formats: txt, vtt, srt, tsv, json, jsonl — default is "all"
whisper audio.mp3 --output_format srt vtt
 
# force CPU; default is cuda when available, otherwise cpu
whisper audio.mp3 --device cpu
 
# fp16 is on by default and falls back to fp32 on CPU automatically; pass --fp16 False to force fp32
whisper audio.mp3 --fp16 False
SizeParametersEnglish-only modelMultilingual modelRequired VRAMRelative speed
tiny39 Mtiny.entiny~1 GB~32x
base74 Mbase.enbase~1 GB~16x
small244 Msmall.ensmall~2 GB~6x
medium769 Mmedium.enmedium~5 GB~2x
large1550 MN/Alarge~10 GB1x

Choosing a model

turbo rounds out the line-up above: ≈6 GB VRAM at roughly 8× large's speed. It's the current CLI default, so whisper audio.mp3 without a --model flag uses it. There is no "plus" model.

.en variants exist only for tiny, base, small, and medium — not for turbo or large.

turbo is not trained for translation. For --task translate (any speech → English) use medium or large; plain transcription (--task transcribe) is the default.

References