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
5f7a07c0
Unverified
Commit
5f7a07c0
authored
Jan 02, 2021
by
Derrick Blakely
Committed by
GitHub
Jan 02, 2021
Browse files
use return dict for rag encoder (#9363)
parent
ae333d04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/rag/modeling_rag.py
src/transformers/models/rag/modeling_rag.py
+1
-1
No files found.
src/transformers/models/rag/modeling_rag.py
View file @
5f7a07c0
...
@@ -1437,7 +1437,7 @@ class RagTokenForGeneration(RagPreTrainedModel):
...
@@ -1437,7 +1437,7 @@ class RagTokenForGeneration(RagPreTrainedModel):
batch_size
=
context_input_ids
.
shape
[
0
]
//
n_docs
batch_size
=
context_input_ids
.
shape
[
0
]
//
n_docs
encoder
=
self
.
rag
.
generator
.
get_encoder
()
encoder
=
self
.
rag
.
generator
.
get_encoder
()
encoder_outputs
=
encoder
(
input_ids
=
context_input_ids
,
attention_mask
=
context_attention_mask
)
encoder_outputs
=
encoder
(
input_ids
=
context_input_ids
,
attention_mask
=
context_attention_mask
,
return_dict
=
True
)
input_ids
=
torch
.
full
(
input_ids
=
torch
.
full
(
(
batch_size
*
num_beams
,
1
),
(
batch_size
*
num_beams
,
1
),
...
...
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