From 405bb58284d1afe262183d23e8ab2c5baa69dd68 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 31 Mar 2026 17:29:07 +0000 Subject: [PATCH] Fix config stamping when SDPA is not supported When supports_sdpa=False and the attention hierarchy selected sdpa, the kwarg was deleted but config._attn_implementation remained as "sdpa". Stamp it to "eager" for consistency before deleting the kwarg. --- unsloth/models/vision.py | 1 + 1 file changed, 1 insertion(+) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index c1a605cfc8..0dae787e22 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -639,6 +639,7 @@ class FastBaseModel: print( f"Unsloth: {model_type_arch.title()} does not support SDPA - switching to fast eager." ) + _set_attn_impl(auto_config, "eager") del kwargs["attn_implementation"] bnb_config = None