Skip to content

Commit

Permalink
fix following huggingface#27907
Browse files Browse the repository at this point in the history
  • Loading branch information
fxmarty committed Dec 8, 2023
1 parent 4721c36 commit 3f06a3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/llama/modeling_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def forward(

kv_seq_len = key_states.shape[-2]
if past_key_value is not None:
kv_seq_len += past_key_value.get_seq_length(self.layer_idx)
kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)

Expand Down

0 comments on commit 3f06a3a

Please sign in to comment.