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
39062d05
"docs/vscode:/vscode.git/clone" did not exist on "ca05c2a47dfab4f1b7d325ee641fed65b0d7a762"
Unverified
Commit
39062d05
authored
Sep 21, 2020
by
guillaume-be
Committed by
GitHub
Sep 21, 2020
Browse files
Fixed target_mapping preparation for XLNet when batch size > 1 (incl. beam search) (#7267)
parent
4b3e55bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_xlnet.py
src/transformers/modeling_xlnet.py
+1
-1
No files found.
src/transformers/modeling_xlnet.py
View file @
39062d05
...
...
@@ -1313,7 +1313,7 @@ class XLNetLMHeadModel(XLNetPreTrainedModel):
target_mapping
=
torch
.
zeros
(
(
effective_batch_size
,
1
,
sequence_length
),
dtype
=
torch
.
float
,
device
=
input_ids
.
device
)
target_mapping
[
0
,
0
,
-
1
]
=
1.0
target_mapping
[
:
,
0
,
-
1
]
=
1.0
inputs
=
{
"input_ids"
:
input_ids
,
...
...
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