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
13b97626
Commit
13b97626
authored
Mar 21, 2021
by
Andy Zou
Browse files
minor
parent
7989168d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lm_eval/tasks/hendrycks_test.py
lm_eval/tasks/hendrycks_test.py
+7
-5
No files found.
lm_eval/tasks/hendrycks_test.py
View file @
13b97626
...
@@ -44,9 +44,10 @@ class GeneralHendrycksTest(MultipleChoiceTask):
...
@@ -44,9 +44,10 @@ class GeneralHendrycksTest(MultipleChoiceTask):
if
not
os
.
path
.
exists
(
self
.
data_dir
):
if
not
os
.
path
.
exists
(
self
.
data_dir
):
sh
(
"""
sh
(
"""
mkdir -p data
mkdir -p data
wget https://people.eecs.berkeley.edu/~hendrycks/hendrycksTest.tar.gz -P data/
wget https://people.eecs.berkeley.edu/~hendrycks/data.tar -P data/
tar -xf data/hendrycksTest.tar.gz -C data/
tar -xf data/data.tar -C data/
rm data/hendrycksTest.tar.gz
rm data/data.tar
mv data/data data/hendrycksTest
"""
)
"""
)
def
has_training_docs
(
self
):
def
has_training_docs
(
self
):
...
@@ -89,8 +90,9 @@ class GeneralHendrycksTest(MultipleChoiceTask):
...
@@ -89,8 +90,9 @@ class GeneralHendrycksTest(MultipleChoiceTask):
def
training_docs
(
self
):
def
training_docs
(
self
):
docs
=
[]
docs
=
[]
# Use all files in the train, dev, val directories (including some UnifiedQA MC tasks)
# Use all files in the auxiliary_train, dev, val directories
for
train_dir
in
[
"train"
,
"dev"
,
"val"
]:
# auxiliary_train includes some UnifiedQA MC tasks
for
train_dir
in
[
"auxiliary_train"
,
"dev"
,
"val"
]:
train_dir
=
os
.
path
.
join
(
self
.
data_dir
,
train_dir
)
train_dir
=
os
.
path
.
join
(
self
.
data_dir
,
train_dir
)
for
f
in
os
.
listdir
(
train_dir
):
for
f
in
os
.
listdir
(
train_dir
):
filename
=
os
.
path
.
join
(
train_dir
,
f
)
filename
=
os
.
path
.
join
(
train_dir
,
f
)
...
...
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