diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 7af1c336fc..b047781e11 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -250,7 +250,7 @@ def determine_attention_implementation(model_class, config): and (model_class is not None) and getattr(model_class, "_supports_flex_attn", False) ): - # GPT-OSS, Mllama and Gemma3 use eager/sdpa attention during + # GPT-OSS, Mllama and Gemma3N use eager/sdpa attention during # inference since flex attention returns incorrect results or errors out. # GPT-OSS: left padding issues cause incorrect outputs. # Mllama: _update_causal_mask uses make_flex_block_causal_mask which diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index c44a77eff0..210f298e65 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -623,9 +623,10 @@ class FastBaseModel: if not ("attn_implementation" in kwargs): kwargs["attn_implementation"] = attn_impl if not supports_sdpa and kwargs.get("attn_implementation") == "sdpa": - print( - f"Unsloth: {model_type_arch.title()} does not support SDPA - switching to fast eager." - ) + if os.environ.get("UNSLOTH_ENABLE_FLEX_ATTENTION", "1") == "0": + print( + f"Unsloth: {model_type_arch.title()} does not support SDPA - switching to fast eager." + ) del kwargs["attn_implementation"] bnb_config = None