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
f921fc19
Commit
f921fc19
authored
Sep 19, 2023
by
lintangsutawika
Browse files
fixed task and benchmark adding process
parent
a2009452
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+9
-6
No files found.
lm_eval/tasks/__init__.py
View file @
f921fc19
...
@@ -104,7 +104,7 @@ def get_task_name_from_config(task_config: Dict[str, str]) -> str:
...
@@ -104,7 +104,7 @@ def get_task_name_from_config(task_config: Dict[str, str]) -> str:
return
"{dataset_path}"
.
format
(
**
task_config
)
return
"{dataset_path}"
.
format
(
**
task_config
)
def
include_task_folder
(
task_dir
:
str
)
->
None
:
def
include_task_folder
(
task_dir
:
str
,
register_task
=
True
)
->
None
:
"""
"""
Calling this function
Calling this function
"""
"""
...
@@ -116,14 +116,15 @@ def include_task_folder(task_dir: str) -> None:
...
@@ -116,14 +116,15 @@ def include_task_folder(task_dir: str) -> None:
try
:
try
:
config
=
utils
.
load_yaml_config
(
yaml_path
)
config
=
utils
.
load_yaml_config
(
yaml_path
)
# If a `task` in config is a list,
if
register_task
:
# that means it's a benchmark
if
type
(
config
[
"task"
])
==
list
:
register_configurable_group
(
config
)
else
:
all_configs
=
check_prompt_config
(
config
)
all_configs
=
check_prompt_config
(
config
)
for
config
in
all_configs
:
for
config
in
all_configs
:
register_configurable_task
(
config
)
register_configurable_task
(
config
)
else
:
# If a `task` in config is a list,
# that means it's a benchmark
if
type
(
config
[
"task"
])
==
list
:
register_configurable_group
(
config
)
except
Exception
as
error
:
except
Exception
as
error
:
eval_logger
.
warning
(
eval_logger
.
warning
(
...
@@ -136,6 +137,8 @@ def include_task_folder(task_dir: str) -> None:
...
@@ -136,6 +137,8 @@ def include_task_folder(task_dir: str) -> None:
task_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
+
"/"
task_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
+
"/"
include_task_folder
(
task_dir
)
include_task_folder
(
task_dir
)
# Register Benchmarks after all tasks have been added
include_task_folder
(
task_dir
,
register_task
=
False
)
def
get_task
(
task_name
,
config
):
def
get_task
(
task_name
,
config
):
...
...
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