beta
This commit is contained in:
@@ -32,7 +32,7 @@ def predict_no_ui(inputs, top_p, temperature, history=[]):
|
||||
# make a POST request to the API endpoint, stream=False
|
||||
response = requests.post(API_URL, headers=headers, proxies=proxies,
|
||||
json=payload, stream=False, timeout=TIMEOUT_SECONDS*2); break
|
||||
except TimeoutError as e:
|
||||
except requests.exceptions.ReadTimeout as e:
|
||||
retry += 1
|
||||
traceback.print_exc()
|
||||
if MAX_RETRY!=0: print(f'请求超时,正在重试 ({retry}/{MAX_RETRY}) ……')
|
||||
@@ -110,7 +110,8 @@ def predict(inputs, top_p, temperature, chatbot=[], history=[], system_prompt=''
|
||||
chunk = get_full_error(chunk, stream_response)
|
||||
error_msg = chunk.decode()
|
||||
if "reduce the length" in error_msg:
|
||||
chatbot[-1] = (history[-1], "[local] input is too long, reduce input or clear history.")
|
||||
chatbot[-1] = (history[-1], "[Local Message] Input (or history) is too long, please reduce input or clear history by refleshing this page.")
|
||||
history = []
|
||||
yield chatbot, history, "Json解析不合常规,很可能是文本过长" + error_msg
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user