kylesayrs commited on
Commit
db2fa7b
·
1 Parent(s): 8651896

fix cache seq length call

Browse files

Signed-off-by: Kyle Sayers <[email protected]>

Files changed (1) hide show
  1. modeling_deepseek.py +1 -1
modeling_deepseek.py CHANGED
@@ -1652,7 +1652,7 @@ class DeepseekV3ForCausalLM(DeepseekV3PreTrainedModel):
1652
  if isinstance(past_key_values, Cache):
1653
  cache_length = past_key_values.get_seq_length()
1654
  past_length = past_key_values.seen_tokens
1655
- max_cache_length = past_key_values.get_max_length()
1656
  else:
1657
  cache_length = past_length = past_key_values[0][0].shape[2]
1658
  max_cache_length = None
 
1652
  if isinstance(past_key_values, Cache):
1653
  cache_length = past_key_values.get_seq_length()
1654
  past_length = past_key_values.seen_tokens
1655
+ max_cache_length = past_key_values.get_max_cache_shape()
1656
  else:
1657
  cache_length = past_length = past_key_values[0][0].shape[2]
1658
  max_cache_length = None