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
d997ac78
Commit
d997ac78
authored
Mar 10, 2020
by
Patrick von Platen
Browse files
fix typo
parent
7351a8db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+1
-1
No files found.
src/transformers/modeling_utils.py
View file @
d997ac78
...
@@ -1281,7 +1281,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
...
@@ -1281,7 +1281,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin):
if
self
.
config
.
is_encoder_decoder
:
if
self
.
config
.
is_encoder_decoder
:
# do not return first <EOS> token
# do not return first <EOS> token
return
decoded
[:,
1
:]
return
decoded
[:,
1
:]
#
return decoded
return
decoded
# force one of token_ids to be generated by setting prob of all other tokens to 0.
# force one of token_ids to be generated by setting prob of all other tokens to 0.
def
_force_token_ids_generation
(
self
,
scores
,
token_ids
):
def
_force_token_ids_generation
(
self
,
scores
,
token_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