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
a67413cc
Commit
a67413cc
authored
Oct 17, 2019
by
Rémi Louf
Browse files
extend works in-place
parent
cb26b035
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/run_seq2seq_finetuning.py
examples/run_seq2seq_finetuning.py
+2
-1
No files found.
examples/run_seq2seq_finetuning.py
View file @
a67413cc
...
@@ -165,7 +165,8 @@ def _fit_to_block_size(sequence, block_size):
...
@@ -165,7 +165,8 @@ def _fit_to_block_size(sequence, block_size):
if
len
(
sequence
)
>
block_size
:
if
len
(
sequence
)
>
block_size
:
return
sequence
[:
block_size
]
return
sequence
[:
block_size
]
else
:
else
:
return
sequence
.
extend
([
0
]
*
(
block_size
-
len
(
sequence
)))
sequence
.
extend
([
0
]
*
(
block_size
-
len
(
sequence
)))
return
sequence
def
mask_padding_tokens
(
sequence
):
def
mask_padding_tokens
(
sequence
):
...
...
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