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
a85ad214
Commit
a85ad214
authored
Sep 14, 2020
by
Jason Phang
Browse files
cleanup
parent
8161c22e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+9
-2
main.py
main.py
+2
-4
write_out.py
write_out.py
+1
-4
No files found.
lm_eval/tasks/__init__.py
View file @
a85ad214
...
...
@@ -19,5 +19,12 @@ for file in os.listdir(tasks_dir):
ALL_TASKS
=
sorted
(
list
(
TASK_REGISTRY
.
registry
))
def
get_task
(
model_name
):
return
TASK_REGISTRY
.
registry
[
model_name
]
def
get_task
(
task_name
):
return
TASK_REGISTRY
.
registry
[
task_name
]
def
get_task_dict
(
task_name_list
):
return
{
task_name
:
get_task
(
task_name
)()
for
task_name
in
task_name_list
}
main.py
View file @
a85ad214
...
...
@@ -28,10 +28,7 @@ def main():
task_names
=
tasks
.
ALL_TASKS
else
:
task_names
=
args
.
tasks
.
split
(
","
)
task_dict
=
{
task_name
:
tasks
.
get_task
(
task_name
)()
for
task_name
in
task_names
}
task_dict
=
tasks
.
get_task_dict
(
task_names
)
results
=
{}
for
task_name
,
task
in
task_dict
.
items
():
if
not
task
.
has_validation_docs
():
...
...
@@ -43,6 +40,7 @@ def main():
num_fewshot
=
args
.
num_fewshot
,
)
results
[
task_name
]
=
result
dumped
=
json
.
dumps
(
results
,
indent
=
2
)
print
(
dumped
)
if
args
.
output_path
:
...
...
write_out.py
View file @
a85ad214
...
...
@@ -28,10 +28,7 @@ def main():
task_names
=
tasks
.
ALL_TASKS
else
:
task_names
=
args
.
tasks
.
split
(
","
)
task_dict
=
{
task_name
:
tasks
.
get_task
(
task_name
)()
for
task_name
in
task_names
}
task_dict
=
tasks
.
get_task_dict
(
task_names
)
os
.
makedirs
(
args
.
output_base_path
,
exist_ok
=
True
)
for
task_name
,
task
in
task_dict
.
items
():
if
not
task
.
has_validation_docs
():
...
...
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