Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lighteval/tasks/multilingual/tasks/arabic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
paper:
"""

import ast
import random
import re
from string import ascii_uppercase
Expand Down Expand Up @@ -600,7 +601,7 @@ def copa_arabic_pfn(line, task_name: str = None):
def hellaswag_arabic_pfn(line, task_name: str = None):
ctx = re.sub(r"\[.*?\]", "", line["ctx"]) # Remove latin words within brackets
endings = [
re.sub(r"\[.*?\]", "", e) for e in eval(line["endings"])
re.sub(r"\[.*?\]", "", e) for e in ast.literal_eval(line["endings"])
] # endings is a string representation of a list
answer_index = line["label"]
instruction = "بناء على السياق التالي، اختر النهاية الصحيحة من الاقتراحات التالية"
Expand Down