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
bd3b599c
Unverified
Commit
bd3b599c
authored
May 14, 2021
by
Oyvind Tafjord
Committed by
GitHub
May 14, 2021
Browse files
Fix T5 beam search using parallelize (#11717)
parent
218d552f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/t5/modeling_t5.py
src/transformers/models/t5/modeling_t5.py
+1
-1
No files found.
src/transformers/models/t5/modeling_t5.py
View file @
bd3b599c
...
...
@@ -1682,7 +1682,7 @@ class T5ForConditionalGeneration(T5PreTrainedModel):
for
layer_past_state
in
layer_past_states
:
# need to set correct `past` for each of the four key / value states
reordered_layer_past_states
=
reordered_layer_past_states
+
(
layer_past_state
.
index_select
(
0
,
beam_idx
),
layer_past_state
.
index_select
(
0
,
beam_idx
.
to
(
layer_past_state
.
device
)
),
)
assert
reordered_layer_past_states
[
0
].
shape
==
layer_past_states
[
0
].
shape
...
...
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