Remove dup gb2312, solve currupt error. (#5326)

### What problem does this PR solve?

#5252 
#5325

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-02-25 12:22:37 +08:00
committed by GitHub
parent ecf5f6976f
commit daddfc9e1b
2 changed files with 3 additions and 1 deletions

View File

@ -47,6 +47,8 @@ class Base(ABC):
model=self.model_name,
messages=history,
**gen_conf)
if not response.choices:
return "", 0
ans = response.choices[0].message.content.strip()
if response.choices[0].finish_reason == "length":
if is_chinese(ans):