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
c1d9e625
Commit
c1d9e625
authored
Jul 02, 2024
by
haileyschoelkopf
Browse files
clean up diff
parent
3b7e6cc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
28 deletions
+1
-28
lm_eval/api/task.py
lm_eval/api/task.py
+0
-22
lm_eval/evaluator.py
lm_eval/evaluator.py
+1
-1
lm_eval/evaluator_utils.py
lm_eval/evaluator_utils.py
+0
-5
No files found.
lm_eval/api/task.py
View file @
c1d9e625
...
@@ -137,7 +137,6 @@ class ConfigurableGroup(abc.ABC):
...
@@ -137,7 +137,6 @@ class ConfigurableGroup(abc.ABC):
config
:
Optional
[
dict
]
=
None
,
config
:
Optional
[
dict
]
=
None
,
)
->
None
:
)
->
None
:
self
.
_config
=
GroupConfig
(
**
config
)
self
.
_config
=
GroupConfig
(
**
config
)
# self._task_id = self._config.group
@
property
@
property
def
group
(
self
):
def
group
(
self
):
...
@@ -155,14 +154,6 @@ class ConfigurableGroup(abc.ABC):
...
@@ -155,14 +154,6 @@ class ConfigurableGroup(abc.ABC):
def
config
(
self
):
def
config
(
self
):
return
self
.
_config
.
to_dict
()
return
self
.
_config
.
to_dict
()
# @property
# def task_id(self) -> Any:
# return self._task_id
# @task_id.setter
# def task_id(self, value):
# self._task_id = value
@
property
@
property
def
group_name
(
self
)
->
Any
:
def
group_name
(
self
)
->
Any
:
return
self
.
_config
.
group
return
self
.
_config
.
group
...
@@ -360,8 +351,6 @@ class Task(abc.ABC):
...
@@ -360,8 +351,6 @@ class Task(abc.ABC):
self
.
_fewshot_docs
:
Optional
[
list
]
=
None
self
.
_fewshot_docs
:
Optional
[
list
]
=
None
self
.
_instances
:
Optional
[
List
[
Instance
]]
=
None
self
.
_instances
:
Optional
[
List
[
Instance
]]
=
None
# Create a unique identifier ID
# self._task_id = shortuuid.uuid()[:8]
self
.
_config
:
TaskConfig
=
TaskConfig
({
**
config
})
if
config
else
TaskConfig
()
self
.
_config
:
TaskConfig
=
TaskConfig
({
**
config
})
if
config
else
TaskConfig
()
self
.
_filters
=
[
build_filter_ensemble
(
"none"
,
[[
"take_first"
,
None
]])]
self
.
_filters
=
[
build_filter_ensemble
(
"none"
,
[[
"take_first"
,
None
]])]
...
@@ -818,14 +807,6 @@ class Task(abc.ABC):
...
@@ -818,14 +807,6 @@ class Task(abc.ABC):
)
)
return
doc_iterator
return
doc_iterator
# @property
# def task_id(self) -> Any:
# return self._task_id
# @task_id.setter
# def task_id(self, value):
# self._task_id = value
class
ConfigurableTask
(
Task
):
class
ConfigurableTask
(
Task
):
VERSION
=
"Yaml"
VERSION
=
"Yaml"
...
@@ -839,9 +820,6 @@ class ConfigurableTask(Task):
...
@@ -839,9 +820,6 @@ class ConfigurableTask(Task):
download_mode
=
None
,
download_mode
=
None
,
config
:
Optional
[
dict
]
=
None
,
config
:
Optional
[
dict
]
=
None
,
)
->
None
:
# TODO no super() call here
)
->
None
:
# TODO no super() call here
# Create a unique identifier ID
# self._task_id = shortuuid.uuid()[:8]
# Get pre-configured attributes
# Get pre-configured attributes
self
.
_config
=
self
.
CONFIG
self
.
_config
=
self
.
CONFIG
...
...
lm_eval/evaluator.py
View file @
c1d9e625
...
@@ -41,7 +41,7 @@ from lm_eval.utils import (
...
@@ -41,7 +41,7 @@ from lm_eval.utils import (
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
lm_eval.api.model
import
LM
from
lm_eval.api.model
import
LM
from
lm_eval.task
s
import
Task
from
lm_eval.
api.
task
import
Task
@
positional_deprecated
@
positional_deprecated
...
...
lm_eval/evaluator_utils.py
View file @
c1d9e625
...
@@ -44,7 +44,6 @@ class TaskOutput:
...
@@ -44,7 +44,6 @@ class TaskOutput:
self
,
self
,
task
=
None
,
task
=
None
,
task_name
=
None
,
task_name
=
None
,
# task_id=None,
task_config
=
None
,
task_config
=
None
,
version
=
None
,
version
=
None
,
group_name
=
None
,
group_name
=
None
,
...
@@ -56,7 +55,6 @@ class TaskOutput:
...
@@ -56,7 +55,6 @@ class TaskOutput:
self
.
task
=
task
self
.
task
=
task
self
.
task_config
=
task_config
self
.
task_config
=
task_config
self
.
task_name
=
task_name
self
.
task_name
=
task_name
# self.task_id = task_id
self
.
group_name
=
group_name
self
.
group_name
=
group_name
self
.
version
=
version
self
.
version
=
version
self
.
n_shot
=
n_shot
self
.
n_shot
=
n_shot
...
@@ -82,7 +80,6 @@ class TaskOutput:
...
@@ -82,7 +80,6 @@ class TaskOutput:
task
=
task
,
task_name
=
task_name
,
is_group
=
is_group
,
group_name
=
group_name
task
=
task
,
task_name
=
task_name
,
is_group
=
is_group
,
group_name
=
group_name
)
)
version
=
task
.
VERSION
version
=
task
.
VERSION
# task_id = task.task_id
task_config
=
dict
(
task
.
dump_config
())
task_config
=
dict
(
task
.
dump_config
())
if
(
n_shot
:
=
task_config
.
get
(
"num_fewshot"
))
==
0
:
if
(
n_shot
:
=
task_config
.
get
(
"num_fewshot"
))
==
0
:
n_shot
=
task_config
.
get
(
"metadata"
,
{}).
get
(
"num_fewshot"
,
0
)
n_shot
=
task_config
.
get
(
"metadata"
,
{}).
get
(
"num_fewshot"
,
0
)
...
@@ -91,7 +88,6 @@ class TaskOutput:
...
@@ -91,7 +88,6 @@ class TaskOutput:
return
cls
(
return
cls
(
task
=
task
,
task
=
task
,
task_name
=
task_name
,
task_name
=
task_name
,
# task_id=task_id,
task_config
=
task_config
,
task_config
=
task_config
,
group_name
=
group_name
,
group_name
=
group_name
,
version
=
version
,
version
=
version
,
...
@@ -321,7 +317,6 @@ def consolidate_results(
...
@@ -321,7 +317,6 @@ def consolidate_results(
higher_is_better
=
collections
.
defaultdict
(
dict
)
higher_is_better
=
collections
.
defaultdict
(
dict
)
for
task_output
in
eval_tasks
:
for
task_output
in
eval_tasks
:
# results[task_output.task_id]["task"] = task_output.task_name
if
"task_alias"
in
(
task_config
:
=
task_output
.
task_config
):
if
"task_alias"
in
(
task_config
:
=
task_output
.
task_config
):
results
[
task_output
.
task_name
][
"alias"
]
=
task_config
[
"task_alias"
]
results
[
task_output
.
task_name
][
"alias"
]
=
task_config
[
"task_alias"
]
else
:
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