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
aef7028c
Commit
aef7028c
authored
May 11, 2024
by
lintangsutawika
Browse files
reformate
parent
79ce346d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lm_eval/tasks/__init__.py
lm_eval/tasks/__init__.py
+9
-5
No files found.
lm_eval/tasks/__init__.py
View file @
aef7028c
...
@@ -177,9 +177,10 @@ class TaskManager:
...
@@ -177,9 +177,10 @@ class TaskManager:
subtask_list
=
self
.
_get_tasklist
(
name_or_config
)
subtask_list
=
self
.
_get_tasklist
(
name_or_config
)
if
subtask_list
==
-
1
:
if
subtask_list
==
-
1
:
group_config
=
self
.
_get_config
(
name_or_config
)
group_config
=
self
.
_get_config
(
name_or_config
)
group_name
,
subtask_list
=
_get_group_and_subtask_from_config
(
group_config
)
group_name
,
subtask_list
=
_get_group_and_subtask_from_config
(
group_config
)
else
:
else
:
# group_name = name_or_config
group_name
=
ConfigurableGroup
(
group_name
=
ConfigurableGroup
(
config
=
{
"group"
:
name_or_config
,
"task"
:
subtask_list
}
config
=
{
"group"
:
name_or_config
,
"task"
:
subtask_list
}
)
)
...
@@ -194,7 +195,6 @@ class TaskManager:
...
@@ -194,7 +195,6 @@ class TaskManager:
if
self
.
_config_is_task
(
name_or_config
):
if
self
.
_config_is_task
(
name_or_config
):
name
=
name_or_config
[
"task"
]
name
=
name_or_config
[
"task"
]
# If the name is registered as a group
# If the name is registered as a group
# if self._name_is_task(name) is False:
if
self
.
_name_is_group
(
name
)
or
self
.
_name_is_tag
(
name
):
if
self
.
_name_is_group
(
name
)
or
self
.
_name_is_tag
(
name
):
update_config
=
{
update_config
=
{
k
:
v
k
:
v
...
@@ -204,7 +204,9 @@ class TaskManager:
...
@@ -204,7 +204,9 @@ class TaskManager:
subtask_list
=
self
.
_get_tasklist
(
name
)
subtask_list
=
self
.
_get_tasklist
(
name
)
if
subtask_list
==
-
1
:
if
subtask_list
==
-
1
:
group_config
=
self
.
_get_config
(
name
)
group_config
=
self
.
_get_config
(
name
)
group_name
,
subtask_list
=
_get_group_and_subtask_from_config
(
group_config
)
group_name
,
subtask_list
=
_get_group_and_subtask_from_config
(
group_config
)
else
:
else
:
group_name
=
ConfigurableGroup
(
group_name
=
ConfigurableGroup
(
config
=
{
"group"
:
group_name
,
"task"
:
subtask_list
}
config
=
{
"group"
:
group_name
,
"task"
:
subtask_list
}
...
@@ -241,7 +243,9 @@ class TaskManager:
...
@@ -241,7 +243,9 @@ class TaskManager:
for
k
,
v
in
name_or_config
.
items
()
for
k
,
v
in
name_or_config
.
items
()
if
k
in
GROUP_ONLY_KEYS
+
[
"task"
,
"group"
]
if
k
in
GROUP_ONLY_KEYS
+
[
"task"
,
"group"
]
}
}
group_name
,
subtask_list
=
_get_group_and_subtask_from_config
(
group_config
)
group_name
,
subtask_list
=
_get_group_and_subtask_from_config
(
group_config
)
if
set
(
name_or_config
.
keys
())
>
{
"task"
,
"group"
}:
if
set
(
name_or_config
.
keys
())
>
{
"task"
,
"group"
}:
update_config
=
{
update_config
=
{
k
:
v
k
:
v
...
...
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