mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
[Update] first_option_postprocess (#1699)
* update first_option_postprocess * update
This commit is contained in:
parent
4653f6976e
commit
98242ff1d1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user