From d94e161691fc571a088f15a0062edd74707115ee Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 21 Mar 2025 15:24:17 -0700 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 027ddf6e89..35396b5be0 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 # =============================================