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
e5b245cc
Commit
e5b245cc
authored
Dec 28, 2023
by
lintangsutawika
Browse files
remove aggregation
parent
039832e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
53 deletions
+0
-53
lm_eval/api/registry.py
lm_eval/api/registry.py
+0
-53
No files found.
lm_eval/api/registry.py
View file @
e5b245cc
...
...
@@ -86,7 +86,6 @@ def register_metric(
metric
=
None
,
higher_is_better
=
None
,
output_type
=
None
,
# aggregation=None,
):
# TODO: do we want to enforce a certain interface to registered metrics?
def
decorate
(
fn
):
...
...
@@ -111,26 +110,6 @@ def register_metric(
for
_output_type
in
output_type_list
:
DEFAULT_METRIC_REGISTRY
[
_output_type
].
append
(
_metric
)
# # for key, registry in [
# # ("output_type", OUTPUT_TYPE_REGISTRY),
# # ("metric", METRIC_REGISTRY),
# # ("higher_is_better", HIGHER_IS_BETTER_REGISTRY),
# # ("aggregation", METRIC_AGGREGATION_REGISTRY),
# # ]:
# # if key in args:
# # value = args[key]
# # assert (
# # value not in registry
# # ), f"{key} named '{value}' conflicts with existing registered {key}!"
# # if key == "metric":
# # registry[name] = fn
# # elif key == "aggregation":
# # registry[name] = AGGREGATION_REGISTRY[value]
# # else:
# # registry[name] = value
return
fn
return
decorate
...
...
@@ -155,38 +134,6 @@ def get_metric(name, hf_evaluate_metric=False):
)
# def register_aggregation(name):
# def decorate(fn):
# assert (
# name not in AGGREGATION_REGISTRY
# ), f"aggregation named '{name}' conflicts with existing registered aggregation!"
# AGGREGATION_REGISTRY[name] = fn
# return fn
# return decorate
# def get_aggregation(name):
# try:
# return AGGREGATION_REGISTRY[name]
# except KeyError:
# eval_logger.warning(
# "{} not a registered aggregation metric!".format(name),
# )
# def get_metric_aggregation(name):
# try:
# return METRIC_AGGREGATION_REGISTRY[name]
# except KeyError:
# eval_logger.warning(
# "{} metric is not assigned a default aggregation!".format(name),
# )
def
is_higher_better
(
metric_name
):
try
:
return
HIGHER_IS_BETTER_REGISTRY
[
metric_name
]
...
...
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