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
gaoqiong
lm-evaluation-harness
Commits
10d4b64a
"vscode:/vscode.git/clone" did not exist on "ce96c3f67c87eb7c09464cf6cfebdebc47c655a6"
Commit
10d4b64a
authored
Jun 09, 2021
by
Leo Gao
Browse files
Minor WikiText fix
parent
5e31e40e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
lm_eval/tasks/wikitext.py
lm_eval/tasks/wikitext.py
+1
-1
No files found.
lm_eval/tasks/wikitext.py
View file @
10d4b64a
...
@@ -65,7 +65,7 @@ class WikiText(PerplexityTask):
...
@@ -65,7 +65,7 @@ class WikiText(PerplexityTask):
def
docs_for_split
(
self
,
split
):
def
docs_for_split
(
self
,
split
):
ret
=
[]
ret
=
[]
for
line
in
open
(
f
"data/wikitext/wikitext-2-raw/wiki.
{
split
}
.raw"
).
read
().
split
(
'
\n
'
):
for
line
in
open
(
f
"data/wikitext/wikitext-2-raw/wiki.
{
split
}
.raw"
).
read
().
split
(
'
\n
'
):
rline
=
line
.
replace
(
"= ="
,
"=="
).
replace
(
"=
=
="
,
"==
=
"
).
strip
()
rline
=
line
.
replace
(
"=
=
="
,
"==
=
"
).
replace
(
"= ="
,
"=="
).
strip
()
if
rline
.
startswith
(
'= '
)
and
rline
.
strip
().
endswith
(
' ='
):
if
rline
.
startswith
(
'= '
)
and
rline
.
strip
().
endswith
(
' ='
):
s
=
'
\n
'
.
join
(
ret
)
s
=
'
\n
'
.
join
(
ret
)
if
s
.
strip
():
yield
s
if
s
.
strip
():
yield
s
...
...
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