diff --git a/samples/tools/autogenbench/scenarios/GAIA/Scripts/custom_tabulate.py b/samples/tools/autogenbench/scenarios/GAIA/Scripts/custom_tabulate.py index ea715d6d2..aba1ef850 100644 --- a/samples/tools/autogenbench/scenarios/GAIA/Scripts/custom_tabulate.py +++ b/samples/tools/autogenbench/scenarios/GAIA/Scripts/custom_tabulate.py @@ -16,7 +16,11 @@ def normalize_answer(a): # Trim (left and right) # Replace multiple spaces with one space # Remove trailing punctuation - return re.sub(r"[\.\!\?]+$", "", re.sub(r"\s+", " ", a.strip().lower())) + norm_answer = re.sub(r"\s+", " ", a.strip().lower()) + if re.search(r"^[\.\!\?]+$", norm_answer): + return norm_answer + else: + return re.sub(r"[\.\!\?]+$", "", norm_answer) def scorer(instance_dir):