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 _utils.py

Daniel Han2f6d65c934d2
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index 027ddf6e89b..35396b5be0c 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -485,7 +485,8 @@ pass
import transformers.generation.configuration_utils
if hasattr(transformers.generation.configuration_utils, "ALL_CACHE_IMPLEMENTATIONS"):
if type(transformers.generation.configuration_utils.ALL_CACHE_IMPLEMENTATIONS) is list:
- transformers.generation.configuration_utils.ALL_CACHE_IMPLEMENTATIONS.append("dynamic")
+ if "dynamic" not in transformers.generation.configuration_utils.ALL_CACHE_IMPLEMENTATIONS:
+ transformers.generation.configuration_utils.ALL_CACHE_IMPLEMENTATIONS.append("dynamic")
pass
pass
# =============================================