fix raptor bugs (#928)

### What problem does this PR solve?

#922 
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
KevinHuSh
2024-05-27 11:01:20 +08:00
committed by GitHub
parent 55fb96131e
commit 46454362d7
8 changed files with 82 additions and 3 deletions

View File

@ -359,7 +359,6 @@ class VolcEngineChat(Base):
if system:
history.insert(0, {"role": "system", "content": system})
ans = ""
tk_count = 0
try:
req = {
"parameters": {
@ -380,6 +379,7 @@ class VolcEngineChat(Base):
if resp.choices[0].finish_reason == "stop":
tk_count = resp.usage.total_tokens
yield ans
except Exception as e:
yield ans + "\n**ERROR**: " + str(e)
yield tk_count