d-Matrix
commited on
Commit
•
bafca02
1
Parent(s):
3c69922
Update modeling_llama.py
Browse files- modeling_llama.py +1 -1
modeling_llama.py
CHANGED
@@ -959,7 +959,7 @@ class LlamaModel(LlamaPreTrainedModel):
|
|
959 |
|
960 |
past_seen_tokens = 0
|
961 |
if use_cache: # kept for BC (cache positions)
|
962 |
-
if past_key_values and not isinstance(past_key_values, StaticCache):
|
963 |
past_key_values = DynamicCache.from_legacy_cache(past_key_values)
|
964 |
past_seen_tokens = past_key_values.get_seq_length()
|
965 |
|
|
|
959 |
|
960 |
past_seen_tokens = 0
|
961 |
if use_cache: # kept for BC (cache positions)
|
962 |
+
if past_key_values is not None and not isinstance(past_key_values, StaticCache):
|
963 |
past_key_values = DynamicCache.from_legacy_cache(past_key_values)
|
964 |
past_seen_tokens = past_key_values.get_seq_length()
|
965 |
|