Merge pull request #58 from tcmofashi/debug

fix: 修复情感标签太相信模型输出的问题
pull/60/head
HYY 2025-03-05 22:37:30 +08:00 committed by GitHub
commit 6e3124eae3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -138,9 +138,12 @@ class ResponseGenerator:
内容{content}
输出
'''
content, _ = await self.model_v3.generate_response(prompt)
return [content.strip()] if content else ["neutral"]
content=content.strip()
if content in ['happy','angry','sad','surprised','disgusted','fearful','neutral']:
return [content]
else:
return ["neutral"]
except Exception as e:
print(f"获取情感标签时出错: {e}")