Upload ./hunyuan.py with huggingface_hub
Browse files- hunyuan.py +1 -1
hunyuan.py
CHANGED
@@ -527,7 +527,7 @@ class HunYuanMoEV1ForCausalLM(HunYuanPreTrainedModel):
|
|
527 |
if isinstance(past_key_values, Cache):
|
528 |
cache_length = past_key_values.get_seq_length()
|
529 |
past_length = past_key_values.seen_tokens
|
530 |
-
max_cache_length = past_key_values.
|
531 |
else:
|
532 |
cache_length = past_length = past_key_values[0][0].shape[2]
|
533 |
max_cache_length = None
|
|
|
527 |
if isinstance(past_key_values, Cache):
|
528 |
cache_length = past_key_values.get_seq_length()
|
529 |
past_length = past_key_values.seen_tokens
|
530 |
+
max_cache_length = past_key_values.get_max_cache_shape()
|
531 |
else:
|
532 |
cache_length = past_length = past_key_values[0][0].shape[2]
|
533 |
max_cache_length = None
|