fix count down error
This commit is contained in:
parent
38705af90b
commit
4c72e6cc80
@ -7,8 +7,8 @@ def predict_no_ui_but_counting_down(i_say, i_say_show_user, chatbot, top_p, temp
|
|||||||
调用简单的predict_no_ui接口,但是依然保留了些许界面心跳功能,当对话太长时,会自动采用二分法截断
|
调用简单的predict_no_ui接口,但是依然保留了些许界面心跳功能,当对话太长时,会自动采用二分法截断
|
||||||
"""
|
"""
|
||||||
import time
|
import time
|
||||||
try: from config_private import TIMEOUT_SECONDS
|
try: from config_private import TIMEOUT_SECONDS, MAX_RETRY
|
||||||
except: from config import TIMEOUT_SECONDS
|
except: from config import TIMEOUT_SECONDS, MAX_RETRY
|
||||||
from predict import predict_no_ui
|
from predict import predict_no_ui
|
||||||
mutable = [None, '']
|
mutable = [None, '']
|
||||||
def mt(i_say, history):
|
def mt(i_say, history):
|
||||||
@ -30,7 +30,7 @@ def predict_no_ui_but_counting_down(i_say, i_say_show_user, chatbot, top_p, temp
|
|||||||
cnt = 0
|
cnt = 0
|
||||||
while thread_name.is_alive():
|
while thread_name.is_alive():
|
||||||
cnt += 1
|
cnt += 1
|
||||||
chatbot[-1] = (i_say_show_user, f"[Local Message] {mutable[1]}waiting gpt response {cnt}/{TIMEOUT_SECONDS*2}"+''.join(['.']*(cnt%4)))
|
chatbot[-1] = (i_say_show_user, f"[Local Message] {mutable[1]}waiting gpt response {cnt}/{TIMEOUT_SECONDS*2*(MAX_RETRY+1)}"+''.join(['.']*(cnt%4)))
|
||||||
yield chatbot, history, '正常'
|
yield chatbot, history, '正常'
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
gpt_say = mutable[0]
|
gpt_say = mutable[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user