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
0a694910
Commit
0a694910
authored
Aug 15, 2023
by
lintangsutawika
Browse files
update
parent
61c49449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
lm_eval/api/task.py
lm_eval/api/task.py
+7
-11
No files found.
lm_eval/api/task.py
View file @
0a694910
...
...
@@ -1029,18 +1029,8 @@ class ConfigurableTask(Task):
choices
=
self
.
doc_to_choice
(
doc
)
gold
=
choices
[
gold
]
if
type
(
gold
)
is
int
:
choices
=
self
.
doc_to_choice
(
doc
)
gold
=
choices
[
gold
]
for
key
,
result
in
zip
(
self
.
_metric_fn_list
.
keys
(),
results
):
if
not
self
.
multiple_target
:
result
=
self
.
_metric_fn_list
[
key
](
references
=
[
gold
],
predictions
=
[
result
],
**
self
.
_metric_fn_kwargs
[
key
],
)
else
:
if
self
.
multiple_target
:
# in the case where we have multiple targets,
# return true if any are true
# TODO: this may break for multipLe_target, non zero-or-1 metrics
...
...
@@ -1059,6 +1049,12 @@ class ConfigurableTask(Task):
result
=
1.0
else
:
result
=
0.0
else
:
result
=
self
.
_metric_fn_list
[
key
](
references
=
[
gold
],
predictions
=
[
result
],
**
self
.
_metric_fn_kwargs
[
key
],
)
if
isinstance
(
result
,
dict
):
result_dict
.
update
(
result
)
...
...
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