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
743677be
Commit
743677be
authored
Jan 19, 2024
by
lintangsutawika
Browse files
add exit after error
parent
ee5e1dc2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
lm_eval/__main__.py
lm_eval/__main__.py
+8
-6
No files found.
lm_eval/__main__.py
View file @
743677be
...
@@ -3,14 +3,13 @@ import json
...
@@ -3,14 +3,13 @@ import json
import
logging
import
logging
import
os
import
os
import
re
import
re
import
sys
from
pathlib
import
Path
from
pathlib
import
Path
from
typing
import
Union
from
typing
import
Union
import
numpy
as
np
import
numpy
as
np
from
lm_eval
import
evaluator
,
utils
from
lm_eval
import
evaluator
,
utils
from
lm_eval.tasks
import
initialize_tasks
from
lm_eval.tasks
import
initialize_tasks
,
load_task_or_group
from
lm_eval.utils
import
make_table
from
lm_eval.utils
import
make_table
...
@@ -165,9 +164,8 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
...
@@ -165,9 +164,8 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
)
)
if
args
.
tasks
is
None
:
if
args
.
tasks
is
None
:
eval_logger
.
error
(
eval_logger
.
error
(
"Need to specify task to evaluate."
)
"Need to specify task to evaluate."
import
sys
;
sys
.
exit
()
)
elif
args
.
tasks
==
"list"
:
elif
args
.
tasks
==
"list"
:
eval_logger
.
info
(
eval_logger
.
info
(
"Available Tasks:
\n
- {}"
.
format
(
"
\n
- "
.
join
(
sorted
(
ALL_TASKS
)))
"Available Tasks:
\n
- {}"
.
format
(
"
\n
- "
.
join
(
sorted
(
ALL_TASKS
)))
...
@@ -225,11 +223,15 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
...
@@ -225,11 +223,15 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
assert
args
.
output_path
,
"Specify --output_path"
assert
args
.
output_path
,
"Specify --output_path"
eval_logger
.
info
(
f
"Selected Tasks:
{
task_names
}
"
)
eval_logger
.
info
(
f
"Selected Tasks:
{
task_names
}
"
)
eval_logger
.
info
(
"Loading selected tasks..."
)
for
task
in
task_names
:
task_objects
=
load_task_or_group
(
ALL_TASKS
[
task
])
results
=
evaluator
.
simple_evaluate
(
results
=
evaluator
.
simple_evaluate
(
model
=
args
.
model
,
model
=
args
.
model
,
model_args
=
args
.
model_args
,
model_args
=
args
.
model_args
,
tasks
=
task_
name
s
,
tasks
=
task_
object
s
,
num_fewshot
=
args
.
num_fewshot
,
num_fewshot
=
args
.
num_fewshot
,
batch_size
=
args
.
batch_size
,
batch_size
=
args
.
batch_size
,
max_batch_size
=
args
.
max_batch_size
,
max_batch_size
=
args
.
max_batch_size
,
...
...
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