Skip to content

Commit

Permalink
🐛 fix error from cohere api
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceunx committed May 2, 2024
1 parent 0844538 commit 96d5d16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gpt_server/routers/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ async def get_content(data):
async for chunk in res.content:
if chunk:
tmp = json.loads(chunk.decode("utf-8"))
if 'text' not in tmp:
continue
if tmp["is_finished"]:
yield "[DONE]"
else:
Expand Down

0 comments on commit 96d5d16

Please sign in to comment.