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
8e093e59
Commit
8e093e59
authored
Apr 23, 2020
by
peterandluc
Committed by
Julien Chaumond
Apr 23, 2020
Browse files
Remove 50k limits bug
parent
6af5a54c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
1 deletion
+0
-1
src/transformers/data/datasets/language_modeling.py
src/transformers/data/datasets/language_modeling.py
+0
-1
No files found.
src/transformers/data/datasets/language_modeling.py
View file @
8e093e59
...
@@ -90,7 +90,6 @@ class LineByLineTextDataset(Dataset):
...
@@ -90,7 +90,6 @@ class LineByLineTextDataset(Dataset):
with
open
(
file_path
,
encoding
=
"utf-8"
)
as
f
:
with
open
(
file_path
,
encoding
=
"utf-8"
)
as
f
:
lines
=
[
line
for
line
in
f
.
read
().
splitlines
()
if
(
len
(
line
)
>
0
and
not
line
.
isspace
())]
lines
=
[
line
for
line
in
f
.
read
().
splitlines
()
if
(
len
(
line
)
>
0
and
not
line
.
isspace
())]
lines
=
lines
[:
50_000
]
batch_encoding
=
tokenizer
.
batch_encode_plus
(
lines
,
add_special_tokens
=
True
,
max_length
=
block_size
)
batch_encoding
=
tokenizer
.
batch_encode_plus
(
lines
,
add_special_tokens
=
True
,
max_length
=
block_size
)
self
.
examples
=
batch_encoding
[
"input_ids"
]
self
.
examples
=
batch_encoding
[
"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