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
eab980fd
Commit
eab980fd
authored
Sep 09, 2019
by
searchivarius
Browse files
Fix to prevent crashing on assert len(tokens_b)>=1
parent
a95ced62
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/lm_finetuning/pregenerate_training_data.py
examples/lm_finetuning/pregenerate_training_data.py
+2
-1
No files found.
examples/lm_finetuning/pregenerate_training_data.py
View file @
eab980fd
...
@@ -329,6 +329,7 @@ def main():
...
@@ -329,6 +329,7 @@ def main():
doc
=
[]
doc
=
[]
else
:
else
:
tokens
=
tokenizer
.
tokenize
(
line
)
tokens
=
tokenizer
.
tokenize
(
line
)
if
tokens
:
doc
.
append
(
tokens
)
doc
.
append
(
tokens
)
if
doc
:
if
doc
:
docs
.
add_document
(
doc
)
# If the last doc didn't end on a newline, make sure it still gets added
docs
.
add_document
(
doc
)
# If the last doc didn't end on a newline, make sure it still gets added
...
...
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