Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
9451a385
Unverified
Commit
9451a385
authored
Aug 01, 2024
by
Sanchit Gandhi
Committed by
GitHub
Aug 01, 2024
Browse files
[enc-dec cache] fix bug in indexing (#32370)
parent
453e7488
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/cache_utils.py
src/transformers/cache_utils.py
+1
-1
No files found.
src/transformers/cache_utils.py
View file @
9451a385
...
...
@@ -1034,7 +1034,7 @@ class EncoderDecoderCache(Cache):
self
.
self_attention_cache
.
key_cache
[
layer_idx
],
self
.
self_attention_cache
.
value_cache
[
layer_idx
],
self
.
cross_attention_cache
.
key_cache
[
layer_idx
],
self
.
cross_attention_cache
.
key
_cache
[
layer_idx
],
self
.
cross_attention_cache
.
value
_cache
[
layer_idx
],
)
else
:
raise
KeyError
(
f
"Cache only has
{
len
(
self
)
}
layers, attempted to access layer with index
{
layer_idx
}
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment