diff --git a/src/transformers/generation/utils.py b/src/transformers/generation/utils.py index 188fa383290901..f0fbc8f77f35fb 100644 --- a/src/transformers/generation/utils.py +++ b/src/transformers/generation/utils.py @@ -2170,9 +2170,9 @@ def typeerror(): type(result.past_key_values) == DynamicCache # noqa E721 or ( isinstance(result.past_key_values, EncoderDecoderCache) - and type(result.past_key_values.self_attention_cache) == DynamicCache - and type(result.past_key_values.cross_attention_cache) == DynamicCache - ) # noqa E721 + and type(result.past_key_values.self_attention_cache) == DynamicCache # noqa E721 + and type(result.past_key_values.cross_attention_cache) == DynamicCache # noqa E721 + ) ) if not is_user_defined_cache and is_default_cache_type: logger.warning_once(