Skip to content

Commit

Permalink
Update modeling_longt5.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrilvallez committed Nov 1, 2024
1 parent 6c80731 commit 5efa057
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/longt5/modeling_longt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ def forward(
# it messes indexing later in decoder-stack because cache object is modified in-place
past_key_values = None

past_key_values_length = past_key_values.get_seq_length() if past_key_values is not None else 0
past_key_values_length = past_key_values.get_past_seen_tokens() if past_key_values is not None else 0
if cache_position is None:
cache_position = torch.arange(
past_key_values_length, past_key_values_length + seq_length, device=inputs_embeds.device
Expand Down

0 comments on commit 5efa057

Please sign in to comment.