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
Hide 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
import
logging
import
os
import
re
import
sys
from
pathlib
import
Path
from
typing
import
Union
import
numpy
as
np
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
...
...
@@ -165,9 +164,8 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
)
if
args
.
tasks
is
None
:
eval_logger
.
error
(
"Need to specify task to evaluate."
)
eval_logger
.
error
(
"Need to specify task to evaluate."
)
import
sys
;
sys
.
exit
()
elif
args
.
tasks
==
"list"
:
eval_logger
.
info
(
"Available Tasks:
\n
- {}"
.
format
(
"
\n
- "
.
join
(
sorted
(
ALL_TASKS
)))
...
...
@@ -225,11 +223,15 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
assert
args
.
output_path
,
"Specify --output_path"
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
(
model
=
args
.
model
,
model_args
=
args
.
model_args
,
tasks
=
task_
name
s
,
tasks
=
task_
object
s
,
num_fewshot
=
args
.
num_fewshot
,
batch_size
=
args
.
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