Skip to content

Commit

Permalink
fix json read error
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-sky committed Aug 29, 2023
1 parent 2cca463 commit 2fa3d47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request_llm/bridge_chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
return

chunk_decoded = chunk.decode()
if is_head_of_the_stream and (r'"object":"error"' not in chunk_decoded) and (r"choices" not in chunk_decoded):
if is_head_of_the_stream and (r'"object":"error"' not in chunk_decoded) and (r"content" not in chunk_decoded):
# 数据流的第一帧不携带content
is_head_of_the_stream = False; continue

Expand Down

0 comments on commit 2fa3d47

Please sign in to comment.