Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Whisper

Daniel Hanb425d9da9eba
diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py
index 2944fcd0714..a233b26a864 100644
--- a/unsloth/models/loader.py
+++ b/unsloth/models/loader.py
@@ -545,6 +545,8 @@ class FastModel(FastBaseModel):
os.environ["UNSLOTH_FORCE_CUSTOM_DTYPE"] = "torch.float16;if name.endswith(('_proj', 'fc1', 'fc2', 'codebook', 'head')): module.to(torch.float16)"
elif "olmo-2" in model_name.lower() and transformers_version < Version("4.50.0.dev0"):
raise RuntimeError("Unsloth: OLMo-2 only works on transformers >= 4.50.0." + NIGHTLY)
+ elif "whisper" in model_name.lower():
+ os.environ["UNSLOTH_DISABLE_STATIC_GENERATION"] = "1" # Whisper fails
pass
if USE_MODELSCOPE and not os.path.exists(model_name):
diff --git a/unsloth/models/mapper.py b/unsloth/models/mapper.py
index fd8b2e60d63..4bbd8295cc7 100644
--- a/unsloth/models/mapper.py
+++ b/unsloth/models/mapper.py
@@ -821,6 +821,22 @@ __INT_TO_FLOAT_MAPPER = \
"unsloth/csm-1b",
"sesame/csm-1b",
),
+ "unsloth/whisper-large-v3" : (
+ "unsloth/whisper-large-v3",
+ "openai/whisper-large-v3",
+ ),
+ "unsloth/whisper-large-v3-turbo" : (
+ "unsloth/whisper-large-v3-turbo",
+ "openai/whisper-large-v3-turbo",
+ ),
+ "unsloth/whisper-small" : (
+ "unsloth/whisper-small",
+ "openai/whisper-small",
+ ),
+ "unsloth/CrisperWhisper" : (
+ "unsloth/CrisperWhisper",
+ "nyrahealth/CrisperWhisper",
+ ),
}
INT_TO_FLOAT_MAPPER = {}