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 Han17a6bc1bd466
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py
index 677c7f8744f..bb84c2d8a65 100644
--- a/unsloth/models/vision.py
+++ b/unsloth/models/vision.py
@@ -184,9 +184,12 @@ def unsloth_base_fast_generate(
if "generation_config" in kwargs:
kwargs["generation_config"].cache_implementation = cache_implementation
kwargs["generation_config"].compile_config = _compile_config
- else:
+ elif getattr(self, "_supports_static_cache", True):
kwargs["cache_implementation"] = cache_implementation
kwargs["compile_config"] = _compile_config
+ else:
+ kwargs["cache_implementation"] = "hybrid"
+ kwargs["compile_config"] = _compile_config
pass
with torch.inference_mode(), autocaster: