Free | No tracking | Every fact with a source|German and English

Error / Models and files

whisper.cpp: invalid model data (bad magic) (model file has the wrong format)

whisper.cpp found the model file, but does not recognize its contents as a ggml Whisper model and stops loading.

The message

whisper_model_load: invalid model data (bad magic)
whisper_init_with_params_no_state: failed to load model

Affects: whisper.cpp, faster-whisper

Why is this happening?

whisper.cpp only reads models in its own ggml format (files like ggml-base.bin). If the program checks the file header and does not find the expected signature, it reports “bad magic”. A typical cause is someone renaming a model for faster-whisper (CTranslate2 format from Hugging Face) or an original PyTorch model to .bin. A faulty download can also cause this, for example an HTML error page saved as .bin or just a small Git LFS placeholder instead of the real file. If whisper.cpp instead only says “failed to open”, the path is probably wrong.

How to fix it

  1. Do not rename other models to .bin. Models from faster-whisper or WhisperX do not run in whisper.cpp.
  2. Check the file size: if the file is only a few kilobytes or starts with an HTML tag in a text editor, the download is broken — download it again.
  3. Download a ready-converted model from the official Hugging Face folder https://huggingface.co/ggerganov/whisper.cpp/tree/main, for example ggml-base.bin or ggml-large-v3.bin.
  4. On Windows, you can also do this in the whisper.cpp folder with a script: .\models\download-ggml-model.cmd base (under Linux/WSL sh ./models/download-ggml-model.sh base).
  5. Pass the new model at startup with -m, for example whisper-cli -m models\ggml-base.bin -f audio.wav.
  6. If you want to use your own or fine-tuned model, convert it with the scripts from the models folder: original PyTorch files (.pt) with convert-pt-to-ggml.py, Hugging Face models with convert-h5-to-ggml.py.

Better not: Do not rely on the file extension: a file is not a ggml model just because it ends in .bin.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 28, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.