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.

Update vision.py

Daniel Han52c62b94200d
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py
index 0497ce43798..bc830efd67c 100644
--- a/unsloth/models/vision.py
+++ b/unsloth/models/vision.py
@@ -185,7 +185,7 @@ def unsloth_base_fast_generate(
# Use hybrid if sliding window seen, otherwise try static
cache_implementation = getattr(self.config, "cache_implementation", None)
if cache_implementation is None:
- swa = getattr(getattr(model.config, "text_config", model.config), "sliding_window", None)
+ swa = getattr(getattr(self.config, "text_config", self.config), "sliding_window", None)
if swa == 0 or type(swa) is not int:
cache_implementation = "static"
else: