Skip to content

Commit

Permalink
Improve string processing order for better whitespace handling (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryoo72 authored Feb 27, 2025
1 parent 00febf5 commit 56cf355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lmms_eval/tasks/mmstar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def mmstar_doc_to_text(doc, lmms_eval_specific_kwargs=None):

def exact_match(pred, gt):
"""Brought from MMStar"""
answer = gt.lower().strip().replace("\n", " ")
predict = pred.lower().strip().replace("\n", " ")
answer = gt.lower().replace("\n", " ").strip()
predict = pred.lower().replace("\n", " ").strip()
try:
if answer == predict[0]:
return 1.0
Expand Down

0 comments on commit 56cf355

Please sign in to comment.