mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 19:21:31 +06:00
parent
4df5b9b4b2
commit
2bbbf1be5b
@ -1139,7 +1139,7 @@ class CohereForCausalLM(CoherePreTrainedModel):
|
||||
# TODO joao: standardize interface for the different Cache classes and remove of this if
|
||||
has_static_cache = False
|
||||
if past_key_values is None:
|
||||
past_key_values = getattr(self.model.layers[0].self_attn, "past_key_value", None)
|
||||
past_key_values = getattr(getattr(self.model.layers[0], "self_attn", {}), "past_key_value", None)
|
||||
has_static_cache = past_key_values is not None
|
||||
|
||||
past_length = 0
|
||||
|
@ -1143,7 +1143,7 @@ class GemmaForCausalLM(GemmaPreTrainedModel):
|
||||
# TODO joao: standardize interface for the different Cache classes and remove of this if
|
||||
has_static_cache = False
|
||||
if past_key_values is None:
|
||||
past_key_values = getattr(self.model.layers[0].self_attn, "past_key_value", None)
|
||||
past_key_values = getattr(getattr(self.model.layers[0], "self_attn", {}), "past_key_value", None)
|
||||
has_static_cache = past_key_values is not None
|
||||
|
||||
past_length = 0
|
||||
|
@ -1240,7 +1240,7 @@ class LlamaForCausalLM(LlamaPreTrainedModel):
|
||||
# TODO joao: standardize interface for the different Cache classes and remove of this if
|
||||
has_static_cache = False
|
||||
if past_key_values is None:
|
||||
past_key_values = getattr(self.model.layers[0].self_attn, "past_key_value", None)
|
||||
past_key_values = getattr(getattr(self.model.layers[0], "self_attn", {}), "past_key_value", None)
|
||||
has_static_cache = past_key_values is not None
|
||||
|
||||
past_length = 0
|
||||
|
Loading…
Reference in New Issue
Block a user