mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
temp
This commit is contained in:
parent
db865dbeda
commit
bf14c4b95a
1 changed files with 0 additions and 11 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue