Your Name commited on
Commit
48cf5c0
1 Parent(s): c5d4e75

兼容性措施

Browse files
Files changed (1) hide show
  1. request_llm/bridge_chatgpt.py +1 -1
request_llm/bridge_chatgpt.py CHANGED
@@ -169,7 +169,7 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
169
  while True:
170
  chunk = next(stream_response)
171
  # print(chunk.decode()[6:])
172
- if is_head_of_the_stream:
173
  # 数据流的第一帧不携带content
174
  is_head_of_the_stream = False; continue
175
 
 
169
  while True:
170
  chunk = next(stream_response)
171
  # print(chunk.decode()[6:])
172
+ if is_head_of_the_stream and (r'"object":"error"' not in chunk.decode()):
173
  # 数据流的第一帧不携带content
174
  is_head_of_the_stream = False; continue
175