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
ad20ec2f
"vscode:/vscode.git/clone" did not exist on "94db0f8a4dfe96cd8b0914c6f7a1a843947d3ca1"
Commit
ad20ec2f
authored
Jan 19, 2024
by
lintangsutawika
Browse files
adjust how task objects are called
parent
743677be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
lm_eval/__main__.py
lm_eval/__main__.py
+13
-3
No files found.
lm_eval/__main__.py
View file @
ad20ec2f
...
...
@@ -168,7 +168,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
import
sys
;
sys
.
exit
()
elif
args
.
tasks
==
"list"
:
eval_logger
.
info
(
"Available Tasks:
\n
- {}"
.
format
(
"
\n
- "
.
join
(
sorted
(
ALL_TASKS
)))
"Available Tasks:
\n
- {}"
.
format
(
"
\n
- "
.
join
(
sorted
(
ALL_TASKS
.
keys
()
)))
)
else
:
if
os
.
path
.
isdir
(
args
.
tasks
):
...
...
@@ -181,7 +181,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
task_names
.
append
(
config
)
else
:
tasks_list
=
args
.
tasks
.
split
(
","
)
task_names
=
utils
.
pattern_match
(
tasks_list
,
ALL_TASKS
)
task_names
=
utils
.
pattern_match
(
tasks_list
,
ALL_TASKS
.
keys
()
)
for
task
in
[
task
for
task
in
tasks_list
if
task
not
in
task_names
]:
if
os
.
path
.
isfile
(
task
):
config
=
utils
.
load_yaml_config
(
task
)
...
...
@@ -225,8 +225,18 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
eval_logger
.
info
(
f
"Selected Tasks:
{
task_names
}
"
)
eval_logger
.
info
(
"Loading selected tasks..."
)
task_objects
=
{}
for
task
in
task_names
:
task_objects
=
load_task_or_group
(
ALL_TASKS
[
task
])
if
isinstance
(
task
,
str
):
task_objects
[
task
]
=
load_task_or_group
(
ALL_TASKS
,
task_name
=
task
,
)
elif
isinstance
(
task
,
dict
):
task_objects
[
task
[
"task"
]]
=
load_task_or_group
(
ALL_TASKS
,
task_config
=
task
,
)
results
=
evaluator
.
simple_evaluate
(
model
=
args
.
model
,
...
...
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