模块化封装

这个提交包含在:
Your Name
2023-03-24 18:04:59 +08:00
父节点 818690037a
当前提交 1cad53f641
共有 6 个文件被更改,包括 194 次插入160 次删除

查看文件

@@ -1,5 +1,5 @@
from predict import predict_no_ui
from toolbox import CatchException, report_execption, write_results_to_file
from toolbox import CatchException, report_execption, write_results_to_file, predict_no_ui_but_counting_down
fast_debug = False
@@ -22,7 +22,7 @@ def 解析Paper(file_manifest, project_folder, top_p, temperature, chatbot, hist
# ** gpt request **
while True:
try:
gpt_say = predict_no_ui(inputs=i_say, top_p=top_p, temperature=temperature)
gpt_say = yield from predict_no_ui_but_counting_down(i_say, i_say_show_user, chatbot, top_p, temperature, history=[]) # 带超时倒计时
break
except ConnectionAbortedError as e:
i_say = i_say[:len(i_say)//2]
@@ -46,7 +46,7 @@ def 解析Paper(file_manifest, project_folder, top_p, temperature, chatbot, hist
# ** gpt request **
while True:
try:
gpt_say = predict_no_ui(inputs=i_say, top_p=top_p, temperature=temperature, history=history)
gpt_say = yield from predict_no_ui_but_counting_down(i_say, i_say_show_user, chatbot, top_p, temperature, history=history) # 带超时倒计时
break
except ConnectionAbortedError as e:
history = [his[len(his)//2:] for his in history]