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
75519897
"official/common/dataset_fn.py" did not exist on "7c34eac7ee0d2a668f0d28f9cd64b8f6988955c6"
Unverified
Commit
75519897
authored
Jun 24, 2021
by
sdtblck
Committed by
GitHub
Jun 24, 2021
Browse files
Don't download lambada if it already exists
parent
3473ea80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lm_eval/tasks/lambada.py
lm_eval/tasks/lambada.py
+7
-5
No files found.
lm_eval/tasks/lambada.py
View file @
75519897
...
...
@@ -3,6 +3,7 @@ from lm_eval.base import Task, rf
from
lm_eval.metrics
import
mean
,
perplexity
from
lm_eval.utils
import
sh
from
best_download
import
download_file
import
os
class
LAMBADA
(
Task
):
...
...
@@ -10,11 +11,12 @@ class LAMBADA(Task):
def
download
(
self
):
sh
(
"mkdir -p data/lambada"
)
try
:
download_file
(
"http://eaidata.bmk.sh/data/lambada_test.jsonl"
,
"data/lambada/lambada_test.jsonl"
,
"4aa8d02cd17c719165fc8a7887fddd641f43fcafa4b1c806ca8abc31fabdb226"
)
if
not
os
.
path
.
exists
(
"data/lambada/lambada_test.jsonl"
):
download_file
(
"http://eaidata.bmk.sh/data/lambada_test.jsonl"
,
"data/lambada/lambada_test.jsonl"
,
"4aa8d02cd17c719165fc8a7887fddd641f43fcafa4b1c806ca8abc31fabdb226"
)
except
:
# fallback - for some reason best_download doesnt work all the time here
sh
(
"wget http://eaidata.bmk.sh/data/lambada_test.jsonl -O data/lambada/lambada_test.jsonl"
)
...
...
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