specsGuy commited on
Commit
a50cbc5
·
verified ·
1 Parent(s): 8ae2e57

Update modeling_deepseekocr.py

Browse files
Files changed (1) hide show
  1. modeling_deepseekocr.py +1 -1
modeling_deepseekocr.py CHANGED
@@ -620,7 +620,7 @@ class DeepseekOCRForCausalLM(DeepseekV2ForCausalLM):
620
  if past_key_values is not None:
621
  if isinstance(past_key_values, Cache):
622
  cache_length = past_key_values.get_seq_length()
623
- past_length = past_key_values.seen_tokens
624
  max_cache_length = past_key_values.get_max_length()
625
  else:
626
  cache_length = past_length = past_key_values[0][0].shape[2]
 
620
  if past_key_values is not None:
621
  if isinstance(past_key_values, Cache):
622
  cache_length = past_key_values.get_seq_length()
623
+ past_length = getattr(past_key_values, "seen_tokens", cache_length)
624
  max_cache_length = past_key_values.get_max_length()
625
  else:
626
  cache_length = past_length = past_key_values[0][0].shape[2]