[Update] first_option_postprocess (#1699)

* update first_option_postprocess

* update
This commit is contained in:
Linchen Xiao 2024-11-18 20:14:29 +08:00 committed by GitHub
parent 4653f6976e
commit 98242ff1d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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