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
b1d468f2
Commit
b1d468f2
authored
Aug 22, 2023
by
haileyschoelkopf
Browse files
fixes to multiple_target
parent
8436e11f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lm_eval/api/task.py
lm_eval/api/task.py
+6
-2
No files found.
lm_eval/api/task.py
View file @
b1d468f2
...
...
@@ -669,9 +669,9 @@ class ConfigurableTask(Task):
check_choices
=
test_target
for
choice
in
check_choices
:
choice_has_whitespace
=
True
if
" "
in
choice
else
False
choice_has_whitespace
=
True
if
choice
.
startswith
(
" "
)
else
False
delimiter_has_whitespace
=
(
True
if
" "
in
self
.
_config
.
target_delimiter
else
False
True
if
self
.
_config
.
target_delimiter
.
startswith
(
" "
)
else
False
)
if
delimiter_has_whitespace
and
choice_has_whitespace
:
...
...
@@ -1050,6 +1050,10 @@ class ConfigurableTask(Task):
# return true if any are true
# TODO: this may break for multipLe_target, non zero-or-1 metrics
scores
=
[]
if
not
isinstance
(
gold
,
list
):
# sometimes, a multiple_target dataset has exceptions where one doc has only one string answer
# print(gold)
gold
=
[
gold
]
for
gold_option
in
gold
:
res
=
self
.
_metric_fn_list
[
key
](
references
=
[
gold_option
],
...
...
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