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
9f75565e
Commit
9f75565e
authored
Nov 08, 2019
by
Rémi Louf
Committed by
Julien Chaumond
Dec 09, 2019
Browse files
setup training
parent
4735c2af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
requirements.txt
requirements.txt
+0
-2
transformers/generate/beam_search.py
transformers/generate/beam_search.py
+1
-1
No files found.
requirements.txt
View file @
9f75565e
...
...
@@ -10,5 +10,3 @@ regex
sentencepiece
# For XLM
sacremoses
# For ROUGE
pyrouge
transformers/generate/beam_search.py
View file @
9f75565e
...
...
@@ -166,7 +166,7 @@ class BeamSearch(object):
for
step
in
range
(
self
.
max_length
):
decoder_input
=
fit_to_block_size
(
self
.
growing_beams
,
block_size
,
self
.
pad_token_id
)
kwargs_decoder
[
"attention_mask"
]
=
build_mask
(
decoder_input
)
kwargs_decoder
[
"attention_mask"
]
=
build_mask
(
decoder_input
,
self
.
pad_token_id
)
outputs
=
self
.
model
.
decoder
(
decoder_input
,
**
kwargs_decoder
)
next_token_scores
=
outputs
[
0
][:,
-
1
,
:].
squeeze
(
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