From 5bbee12ac9c57ac1f085847c0dd7f19d0339be22 Mon Sep 17 00:00:00 2001 From: Joao Gante Date: Fri, 31 Jan 2025 15:53:06 +0000 Subject: [PATCH] [Moshi] disable automatic compilation if the model can't compile (#35992) moshi cant compile --- src/transformers/generation/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/generation/utils.py b/src/transformers/generation/utils.py index fed276b32..45558bd22 100644 --- a/src/transformers/generation/utils.py +++ b/src/transformers/generation/utils.py @@ -3183,7 +3183,7 @@ class GenerationMixin: model_forward = self.__call__ if isinstance(model_kwargs.get("past_key_values"), Cache): - is_compileable = model_kwargs["past_key_values"].is_compileable + is_compileable = model_kwargs["past_key_values"].is_compileable and self._supports_static_cache if is_compileable and ( self.device.type == "cuda" or generation_config.compile_config._compile_all_devices ):