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
8310e67e
Commit
8310e67e
authored
Sep 22, 2023
by
Chris
Browse files
Fix formatting
parent
ad4ab52a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
lm_eval/api/registry.py
lm_eval/api/registry.py
+1
-1
lm_eval/api/task.py
lm_eval/api/task.py
+9
-3
lm_eval/filters/transformation.py
lm_eval/filters/transformation.py
+3
-1
No files found.
lm_eval/api/registry.py
View file @
8310e67e
lm_eval/api/task.py
View file @
8310e67e
...
@@ -555,9 +555,13 @@ class ConfigurableTask(Task):
...
@@ -555,9 +555,13 @@ class ConfigurableTask(Task):
kwargs
=
{
kwargs
=
{
key
:
metric_config
[
key
]
key
:
metric_config
[
key
]
for
key
in
metric_config
for
key
in
metric_config
if
key
not
in
[
"metric"
,
"aggregation"
,
"higher_is_better"
,
"hf_evaluate"
]
if
key
not
in
[
"metric"
,
"aggregation"
,
"higher_is_better"
,
"hf_evaluate"
]
}
}
hf_evaluate_metric
=
"hf_evaluate"
in
metric_config
and
metric_config
[
"hf_evaluate"
]
is
True
hf_evaluate_metric
=
(
"hf_evaluate"
in
metric_config
and
metric_config
[
"hf_evaluate"
]
is
True
)
if
self
.
config
.
process_results
is
not
None
:
if
self
.
config
.
process_results
is
not
None
:
self
.
_metric_fn_list
[
metric_name
]
=
None
self
.
_metric_fn_list
[
metric_name
]
=
None
...
@@ -568,7 +572,9 @@ class ConfigurableTask(Task):
...
@@ -568,7 +572,9 @@ class ConfigurableTask(Task):
self
.
_metric_fn_list
[
metric_name
]
=
metric_fn
self
.
_metric_fn_list
[
metric_name
]
=
metric_fn
self
.
_metric_fn_kwargs
[
metric_name
]
=
kwargs
self
.
_metric_fn_kwargs
[
metric_name
]
=
kwargs
else
:
else
:
self
.
_metric_fn_list
[
metric_name
]
=
get_metric
(
metric_name
,
hf_evaluate_metric
)
self
.
_metric_fn_list
[
metric_name
]
=
get_metric
(
metric_name
,
hf_evaluate_metric
)
self
.
_metric_fn_kwargs
[
metric_name
]
=
kwargs
self
.
_metric_fn_kwargs
[
metric_name
]
=
kwargs
if
"aggregation"
in
metric_config
:
if
"aggregation"
in
metric_config
:
...
...
lm_eval/filters/transformation.py
View file @
8310e67e
...
@@ -37,7 +37,9 @@ class MapFilter(Filter):
...
@@ -37,7 +37,9 @@ class MapFilter(Filter):
Example:
Example:
mapper = MapFilter({'A': 1, 'B': 2}, default_value=0)
mapper = MapFilter({'A': 1, 'B': 2}, default_value=0)
"""
"""
assert
isinstance
(
mapping_dict
,
dict
),
"Provided mapping_dict is not a dictionary"
assert
isinstance
(
mapping_dict
,
dict
),
"Provided mapping_dict is not a dictionary"
self
.
mapping_dict
=
mapping_dict
self
.
mapping_dict
=
mapping_dict
self
.
default_value
=
default_value
self
.
default_value
=
default_value
...
...
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