From 8cfcc82d0ff4732e4a25fcfdca7986c587136fc6 Mon Sep 17 00:00:00 2001 From: Adam Fourney Date: Wed, 28 Feb 2024 15:35:04 -0800 Subject: [PATCH] Fixed some reporting in custom_tabulate.py --- .../autogenbench/scenarios/GAIA/Scripts/custom_tabulate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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):