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.

Fix Nonetype on the compile_config

Erland3663cdbd879f747
diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py
index b335fd02df4..64f4d71b6f7 100644
--- a/unsloth/models/vision.py
+++ b/unsloth/models/vision.py
@@ -200,12 +200,14 @@ def unsloth_base_fast_generate(
cache_implementation = "static"
else:
cache_implementation = "hybrid"
+
if "generation_config" in kwargs:
kwargs["generation_config"].cache_implementation = cache_implementation
kwargs["generation_config"].compile_config = _compile_config if cache_implementation is not None else None
else:
kwargs["cache_implementation"] = cache_implementation
- kwargs["compile_config"] = _compile_config if cache_implementation is not None else None
+ if cache_implementation:
+ kwargs["compile_config"] = _compile_config
pass
try: