Skip to content

Commit

Permalink
Hardcode logic for handling anls
Browse files Browse the repository at this point in the history
  • Loading branch information
brian.li committed Nov 2, 2024
1 parent 967bbb4 commit fc9dfdf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lmms_eval/api/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ def process_results(self, doc, results, full_docs=None):
gold = type(result)(gold)

for metric in self._metric_fn_list.keys():
if self.multiple_target:
if self.multiple_target and metric != "anls":
# 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
Expand All @@ -1535,9 +1535,11 @@ def process_results(self, doc, results, full_docs=None):
else:
result_score = 0.0
else:
if not isinstance(gold, list):
gold = [gold]
try:
result_score = self._metric_fn_list[metric](
references=[gold],
references=gold,
predictions=[result],
**self._metric_fn_kwargs[metric],
)
Expand Down

0 comments on commit fc9dfdf

Please sign in to comment.