Skip to content

Commit

Permalink
Bug fix: Some non-standard forms of error return are not caught (#1877)
Browse files Browse the repository at this point in the history
  • Loading branch information
Menghuan1918 committed Jul 1, 2024
1 parent 18d3245 commit 6cd2d80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion request_llms/oai_std_model_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def decode_chunk(chunk):
try:
chunk = json.loads(chunk[6:])
except:
finish_reason = "JSON_ERROR"
respose = "API_ERROR"
finish_reason = chunk
# 错误处理部分
if "error" in chunk:
respose = "API_ERROR"
Expand Down

0 comments on commit 6cd2d80

Please sign in to comment.