Spaces:
Runtime error
Runtime error
fix count down error
Browse files- toolbox.py +3 -3
toolbox.py
CHANGED
|
@@ -7,8 +7,8 @@ def predict_no_ui_but_counting_down(i_say, i_say_show_user, chatbot, top_p, temp
|
|
| 7 |
调用简单的predict_no_ui接口,但是依然保留了些许界面心跳功能,当对话太长时,会自动采用二分法截断
|
| 8 |
"""
|
| 9 |
import time
|
| 10 |
-
try: from config_private import TIMEOUT_SECONDS
|
| 11 |
-
except: from config import TIMEOUT_SECONDS
|
| 12 |
from predict import predict_no_ui
|
| 13 |
mutable = [None, '']
|
| 14 |
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
|
|
| 30 |
cnt = 0
|
| 31 |
while thread_name.is_alive():
|
| 32 |
cnt += 1
|
| 33 |
-
chatbot[-1] = (i_say_show_user, f"[Local Message] {mutable[1]}waiting gpt response {cnt}/{TIMEOUT_SECONDS*2}"+''.join(['.']*(cnt%4)))
|
| 34 |
yield chatbot, history, '正常'
|
| 35 |
time.sleep(1)
|
| 36 |
gpt_say = mutable[0]
|
|
|
|
| 7 |
调用简单的predict_no_ui接口,但是依然保留了些许界面心跳功能,当对话太长时,会自动采用二分法截断
|
| 8 |
"""
|
| 9 |
import time
|
| 10 |
+
try: from config_private import TIMEOUT_SECONDS, MAX_RETRY
|
| 11 |
+
except: from config import TIMEOUT_SECONDS, MAX_RETRY
|
| 12 |
from predict import predict_no_ui
|
| 13 |
mutable = [None, '']
|
| 14 |
def mt(i_say, history):
|
|
|
|
| 30 |
cnt = 0
|
| 31 |
while thread_name.is_alive():
|
| 32 |
cnt += 1
|
| 33 |
+
chatbot[-1] = (i_say_show_user, f"[Local Message] {mutable[1]}waiting gpt response {cnt}/{TIMEOUT_SECONDS*2*(MAX_RETRY+1)}"+''.join(['.']*(cnt%4)))
|
| 34 |
yield chatbot, history, '正常'
|
| 35 |
time.sleep(1)
|
| 36 |
gpt_say = mutable[0]
|