mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
parent
1de7dc7403
commit
dc76e9fa7f
@ -1394,7 +1394,7 @@ class GenerationMixin:
|
|||||||
return model_kwargs
|
return model_kwargs
|
||||||
|
|
||||||
past_length = 0
|
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):
|
if isinstance(model_kwargs["past_key_values"], Cache):
|
||||||
past_length = model_kwargs["past_key_values"].get_seq_length()
|
past_length = model_kwargs["past_key_values"].get_seq_length()
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user