[Attention] Small fix on output attentions (#38948)

small fix
This commit is contained in:
Anton Vlasjuk 2025-06-24 14:42:10 +02:00 committed by GitHub
parent 4f650040a6
commit 23c89a6732
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -338,7 +338,7 @@ class PretrainedConfig(PushToHubMixin):
@output_attentions.setter @output_attentions.setter
def output_attentions(self, value): def output_attentions(self, value):
if self._attn_implementation != "eager": if value is True and self._attn_implementation != "eager":
raise ValueError( raise ValueError(
"The `output_attentions` attribute is not supported when using the `attn_implementation` set to " "The `output_attentions` attribute is not supported when using the `attn_implementation` set to "
f"{self._attn_implementation}. Please set it to 'eager' instead." f"{self._attn_implementation}. Please set it to 'eager' instead."