openai/whisper · error · RuntimeError
Model {name} not found; available models = {available_models
Error message
Model {name} not found; available models = {available_models()} What it means
whisper.load_model(name) only accepts (a) a key of the _MODELS registry (tiny, base, small, medium, large-v1/v2/v3, large-v3-turbo, turbo, and their .en variants) or (b) a path to an existing checkpoint file. Anything else raises RuntimeError listing the valid names.
Source
Thrown at whisper/__init__.py:143
-------
model : Whisper
The Whisper ASR model instance
"""
if device is None:
device = "cuda" if torch.cuda.is_available() else "cpu"
if download_root is None:
default = os.path.join(os.path.expanduser("~"), ".cache")
download_root = os.path.join(os.getenv("XDG_CACHE_HOME", default), "whisper")
if name in _MODELS:
checkpoint_file = _download(_MODELS[name], download_root, in_memory)
alignment_heads = _ALIGNMENT_HEADS[name]
elif os.path.isfile(name):
checkpoint_file = open(name, "rb").read() if in_memory else name
alignment_heads = None
else:
raise RuntimeError(
f"Model {name} not found; available models = {available_models()}"
)
with (
io.BytesIO(checkpoint_file) if in_memory else open(checkpoint_file, "rb")
) as fp:
kwargs = {"weights_only": True} if torch.__version__ >= "1.13" else {}
checkpoint = torch.load(fp, map_location=device, **kwargs)
del checkpoint_file
dims = ModelDimensions(**checkpoint["dims"])
model = Whisper(dims)
model.load_state_dict(checkpoint["model_state_dict"])
if alignment_heads is not None:
model.set_alignment_heads(alignment_heads)
return model.to(device)View on GitHub (pinned to 5f86d1d863)
Solutions
- Print valid names: python -c "import whisper; print(whisper.available_models())" and use one of those exactly
- For a local checkpoint, pass an absolute path: os.path.abspath(path), and confirm it exists first
- Check spelling of the .en variants — the separator is a dot ('base.en', not 'base-en')
- If the checkpoint is on another machine/symlink, verify os.path.isfile() resolves to True from the same process/CWD
Example fix
# before
model = whisper.load_model("medium-en") # RuntimeError: Model not found
# after
import whisper, os
name = "medium.en" # or a real path:
# name = os.path.abspath("checkpoints/finetuned.pt")
assert name in whisper.available_models() or os.path.isfile(name)
model = whisper.load_model(name) Defensive patterns
Strategy: type-guard
Validate before calling
import os, whisper
def is_loadable_model(name: str) -> bool:
return name in whisper.available_models() or os.path.isfile(name) Type guard
from typing import Literal
ModelName = Literal["tiny", "base", "small", "medium", "large-v1", "large-v2", "large-v3", "large-v3-turbo", "turbo", "tiny.en", "base.en", "small.en", "medium.en"]
def is_model_name(v: str) -> "TypeGuard[ModelName]":
import whisper
return v in whisper.available_models() Try / catch
try:
model = whisper.load_model(name)
except RuntimeError as e:
if "not found; available models" in str(e):
raise ValueError(f"bad model {name!r}; valid: {whisper.available_models()}") from e
raise Prevention
- Derive model names from whisper.available_models() instead of hardcoding strings
- Always os.path.abspath() local checkpoint paths before passing them
- Pin the openai-whisper version so the model registry cannot change under you
When it happens
Trigger: load_model('medium-en') (wrong separator, real name is 'medium.en'), load_model('whisper-large-v3'), or a relative path like load_model('models/base.pt') when the CWD is different — os.path.isfile(name) fails, so the name falls through to the error branch.
Common situations: Typos in model names (hyphen vs dot, missing .en), running a script from a different working directory with a relative checkpoint path, using a fine-tuned checkpoint path that does not exist yet, or assuming a model name from a different fork (e.g. faster-whisper/faster_distilrobust) exists here.
Related errors
- model should be one of {available_models()} or path to a mod
- {download_target} exists and is not a regular file
- Expected one of {set(str2val.keys())}, got {string}
- Language {language} not found in tokenizer.
- Unsupported language: {language}
AI-assisted analysis of openai/whisper@5f86d1d863 (2026-08-14).
Data as JSON: /api/errors/d55663df38282c00.
Report an issue: GitHub.