[generate] fix default autocompile case on gpu (#37756)

This commit is contained in:
Joao Gante
2025-04-24 15:08:38 +01:00
committed by GitHub
parent 43bb4c0456
commit 4d64c38593
2 changed files with 3 additions and 1 deletions

View File

@@ -5270,6 +5270,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, PushToHubMixin, PeftAdapterMi
# Only reset it if not present or different from previous config
if "llama4" in self.config.model_type: # TODO try to enable for FULL COMPILE HYBRID CACHE SUPPORT
return self.__call__
compile_config = compile_config or CompileConfig()
default_config = getattr(self.generation_config, "compile_config", None) or CompileConfig()
if (
not hasattr(self, "_compiled_call")