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
5c18825a
Commit
5c18825a
authored
Aug 06, 2019
by
LysandreJik
Browse files
Removed dataset limit
parent
3e3e1454
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/utils_lm.py
examples/utils_lm.py
+1
-1
No files found.
examples/utils_lm.py
View file @
5c18825a
...
@@ -14,7 +14,7 @@ class WikiTextDataset(Dataset):
...
@@ -14,7 +14,7 @@ class WikiTextDataset(Dataset):
with
open
(
os
.
path
.
join
(
directory
,
f
"wiki.
{
file
}
.raw"
),
encoding
=
"utf-8"
)
as
f
:
with
open
(
os
.
path
.
join
(
directory
,
f
"wiki.
{
file
}
.raw"
),
encoding
=
"utf-8"
)
as
f
:
text
=
f
.
read
()
text
=
f
.
read
()
spans
=
list
(
filter
(
lambda
item
:
len
(
item
)
>
120
,
text
.
split
(
"
\n
"
)
[:
20
]
))
spans
=
list
(
filter
(
lambda
item
:
len
(
item
)
>
120
,
text
.
split
(
"
\n
"
)))
for
span
in
spans
:
for
span
in
spans
:
span
=
tokenizer
.
encode
(
span
)
span
=
tokenizer
.
encode
(
span
)
...
...
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