新增谷歌学术统合小助手

这个提交包含在:
Your Name
2023-04-07 23:54:24 +08:00
父节点 7f1c7ebd68
当前提交 6b5c2538cf
共有 3 个文件被更改,包括 116 次插入1 次删除

查看文件

@@ -104,7 +104,10 @@ def predict_no_ui_long_connection(inputs, top_p, temperature, history=[], sys_pr
result = ''
while True:
try: chunk = next(stream_response).decode()
except StopIteration: break
except StopIteration:
break
except requests.exceptions.ConnectionError:
chunk = next(stream_response).decode() # 失败了,重试一次?再失败就没办法了。
if len(chunk)==0: continue
if not chunk.startswith('data:'):
error_msg = get_full_error(chunk.encode('utf8'), stream_response).decode()