mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-14 20:58:08 +00:00
parent
1de7dc7403
commit
dc76e9fa7f
1 changed files with 1 additions and 1 deletions
|
|
@ -1394,7 +1394,7 @@ class GenerationMixin:
|
|||
return model_kwargs
|
||||
|
||||
past_length = 0
|
||||
if "past_key_values" in model_kwargs:
|
||||
if model_kwargs.get("past_key_values") is not None:
|
||||
if isinstance(model_kwargs["past_key_values"], Cache):
|
||||
past_length = model_kwargs["past_key_values"].get_seq_length()
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue