diff --git a/opencompass/utils/text_postprocessors.py b/opencompass/utils/text_postprocessors.py index 367fcbd1..16083a0b 100644 --- a/opencompass/utils/text_postprocessors.py +++ b/opencompass/utils/text_postprocessors.py @@ -128,7 +128,10 @@ def first_option_postprocess(text: str, options: str, cushion=True) -> str: text = text.strip() match = re.search(pattern, text, re.DOTALL) if match: - outputs = match.group(1) + if match.group(1) is not None and match.group(1) != '': + outputs = match.group(1) + else: + outputs = match.group(0) for i in options: if i in outputs: return i