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
068f8ab2
Commit
068f8ab2
authored
Jun 21, 2023
by
lintangsutawika
Browse files
can include paths in main
parent
7e565f33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
lm_eval/api/task.py
lm_eval/api/task.py
+3
-2
main.py
main.py
+6
-0
No files found.
lm_eval/api/task.py
View file @
068f8ab2
...
...
@@ -70,6 +70,7 @@ class TaskConfig(dict):
doc_to_target
:
Union
[
Callable
,
str
]
=
None
doc_to_choice
:
Union
[
Callable
,
str
,
dict
,
list
]
=
None
gold_alias
:
Union
[
Callable
,
str
]
=
None
process_results
:
Union
[
Callable
,
str
]
=
None
use_prompt
:
str
=
None
description
:
str
=
""
target_delimiter
:
str
=
" "
...
...
@@ -884,8 +885,8 @@ class ConfigurableTask(Task):
def
process_results
(
self
,
doc
,
results
):
#
if callable(self._config.process_results):
#
return self._config.process_results(doc, results)
if
callable
(
self
.
_config
.
process_results
):
return
self
.
_config
.
process_results
(
doc
,
results
)
result_dict
=
{}
use_metric
=
list
(
self
.
_metric_fn_list
.
keys
())
...
...
main.py
View file @
068f8ab2
...
...
@@ -9,6 +9,7 @@ import logging
from
lm_eval
import
evaluator
,
utils
from
lm_eval.api.registry
import
ALL_TASKS
from
lm_eval.logger
import
eval_logger
from
lm_eval.tasks
import
include_task_folder
os
.
environ
[
"TOKENIZERS_PARALLELISM"
]
=
"false"
...
...
@@ -30,6 +31,7 @@ def parse_args():
help
=
"Maximal batch size to try with --batch_size auto"
,
)
parser
.
add_argument
(
"--device"
,
type
=
str
,
default
=
None
)
parser
.
add_argument
(
"--include_path"
,
default
=
None
)
parser
.
add_argument
(
"--output_path"
,
default
=
None
)
parser
.
add_argument
(
"--limit"
,
...
...
@@ -56,6 +58,10 @@ def main():
"REAL METRICS SHOULD NOT BE COMPUTED USING LIMIT."
)
if
args
.
include_path
is
not
None
:
eval_logger
.
info
(
f
"Including path:
{
args
.
include_path
}
"
)
include_task_folder
(
args
.
include_path
)
if
args
.
tasks
is
None
:
task_names
=
ALL_TASKS
else
:
...
...
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