Skip to content

Commit 11521c0

Browse files
author
Duc Hoang
committed
update
1 parent f82255e commit 11521c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lighteval/tasks/default_prompts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,12 +2478,12 @@ def truthful_qa_multiple_choice(line, task_name: str = None):
24782478

24792479
def truthful_qa_generative(line, task_name: str = None): # BLEU and combination of BLEU
24802480
correct_answers = [
2481-
answer.strip() + "" if answer[-1] == "." else "." for answer in line["correct_answers"] if answer != ""
2481+
answer.strip() + ("" if answer.strip().endswith(".") else ".") for answer in line["correct_answers"] if answer.strip() != ""
24822482
]
24832483
if "I have no comment." not in correct_answers:
24842484
correct_answers.append("I have no comment.")
24852485
incorrect_answers = [
2486-
answer.strip() + "" if answer[-1] == "." else "." for answer in line["incorrect_answers"] if answer != ""
2486+
answer.strip() + ("" if answer.strip().endswith(".") else ".") for answer in line["incorrect_answers"] if answer.strip() != ""
24872487
]
24882488

24892489
return Doc(

0 commit comments

Comments
 (0)