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
41ecaba8
Commit
41ecaba8
authored
Feb 04, 2025
by
Baber
Browse files
add to task_manager
parent
86cf5dc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
lm_eval/__main__.py
lm_eval/__main__.py
+11
-1
lm_eval/evaluator.py
lm_eval/evaluator.py
+2
-1
No files found.
lm_eval/__main__.py
View file @
41ecaba8
...
...
@@ -262,6 +262,11 @@ def setup_parser() -> argparse.ArgumentParser:
action
=
"store_true"
,
help
=
"Confirm that you understand the risks of running unsafe code for tasks that require it"
,
)
parser
.
add_argument
(
"--mcq_to_generative"
,
action
=
"store_true"
,
help
=
"Convert multiple choice tasks to generative tasks, for models that don't support logit outputs"
,
)
return
parser
...
...
@@ -306,7 +311,11 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
if
args
.
include_path
is
not
None
:
eval_logger
.
info
(
f
"Including path:
{
args
.
include_path
}
"
)
task_manager
=
TaskManager
(
args
.
verbosity
,
include_path
=
args
.
include_path
)
task_manager
=
TaskManager
(
args
.
verbosity
,
include_path
=
args
.
include_path
,
mcq_to_generative
=
args
.
mcq_to_generative
,
)
if
"push_samples_to_hub"
in
evaluation_tracker_args
and
not
args
.
log_samples
:
eval_logger
.
warning
(
...
...
@@ -410,6 +419,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
torch_random_seed
=
args
.
seed
[
2
],
fewshot_random_seed
=
args
.
seed
[
3
],
confirm_run_unsafe_code
=
args
.
confirm_run_unsafe_code
,
mcq_to_generative
=
args
.
mcq_to_generative
,
**
request_caching_args
,
)
...
...
lm_eval/evaluator.py
View file @
41ecaba8
...
...
@@ -75,6 +75,7 @@ def simple_evaluate(
torch_random_seed
:
int
=
1234
,
fewshot_random_seed
:
int
=
1234
,
confirm_run_unsafe_code
:
bool
=
False
,
mcq_to_generative
:
bool
=
False
,
):
"""Instantiate and evaluate a model on a list of tasks.
...
...
@@ -231,7 +232,7 @@ def simple_evaluate(
)
if
task_manager
is
None
:
task_manager
=
TaskManager
(
verbosity
)
task_manager
=
TaskManager
(
verbosity
,
mcq_to_generative
=
mcq_to_generative
)
task_dict
=
get_task_dict
(
tasks
,
task_manager
)
...
...
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