From bf14c4b95a26f3a6882e70d49e21f96d46f5b6bb Mon Sep 17 00:00:00 2001 From: ydshieh Date: Tue, 17 Dec 2024 16:14:37 +0100 Subject: [PATCH] temp --- .../models/kosmos2_5/modeling_kosmos2_5.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/transformers/models/kosmos2_5/modeling_kosmos2_5.py b/src/transformers/models/kosmos2_5/modeling_kosmos2_5.py index d78457394..88cfe1b35 100644 --- a/src/transformers/models/kosmos2_5/modeling_kosmos2_5.py +++ b/src/transformers/models/kosmos2_5/modeling_kosmos2_5.py @@ -1503,17 +1503,6 @@ class Kosmos2_5TextTransformer(nn.Module): hidden_states = nn.functional.dropout(hidden_states, p=self.dropout, training=self.training) - return_legacy_cache = False - if ( - use_cache and not isinstance(past_key_values, Cache) and not self.training - ): # kept for BC (non `Cache` `past_key_values` inputs) - return_legacy_cache = True - past_key_values = DynamicCache.from_legacy_cache(past_key_values) - logger.warning_once( - "We detected that you are passing `past_key_values` as a tuple and this is deprecated and will be removed in v4.43. " - "Please use an appropriate `Cache` class (https://huggingface.co/docs/transformers/v4.41.3/en/internal/generation_utils#transformers.Cache)" - ) - if cache_position is None: past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0 cache_position = torch.arange(