Skip to content

Commit

Permalink
[Moshi] disable automatic compilation if the model can't compile (hug…
Browse files Browse the repository at this point in the history
…gingface#35992)

moshi cant compile
  • Loading branch information
gante authored and elvircrn committed Feb 13, 2025
1 parent 559a612 commit 0f0bbc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,7 @@ def _sample(

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
):
Expand Down

0 comments on commit 0f0bbc7

Please sign in to comment.