Spaces:
Runtime error
Runtime error
修复chatbotwithcookies的对象传递问题
Browse files- toolbox.py +3 -5
toolbox.py
CHANGED
@@ -54,7 +54,7 @@ def update_ui(chatbot, history, msg='正常', **kwargs): # 刷新界面
|
|
54 |
刷新用户界面
|
55 |
"""
|
56 |
assert isinstance(chatbot, ChatBotWithCookies), "在传递chatbot的过程中不要将其丢弃。必要时,可用clear将其清空,然后用for+append循环重新赋值。"
|
57 |
-
yield chatbot.get_cookies(), chatbot
|
58 |
############################### ################## #######################################
|
59 |
##########################################################################################
|
60 |
|
@@ -340,11 +340,9 @@ def format_io(self, y):
|
|
340 |
return []
|
341 |
i_ask, gpt_reply = y[-1]
|
342 |
i_ask = text_divide_paragraph(i_ask) # 输入部分太自由,预处理一波
|
343 |
-
gpt_reply = close_up_code_segment_during_stream(
|
344 |
-
gpt_reply) # 当代码输出半截的时候,试着补上后个```
|
345 |
y[-1] = (
|
346 |
-
None if i_ask is None else markdown.markdown(
|
347 |
-
i_ask, extensions=['fenced_code', 'tables']),
|
348 |
None if gpt_reply is None else markdown_convertion(gpt_reply)
|
349 |
)
|
350 |
return y
|
|
|
54 |
刷新用户界面
|
55 |
"""
|
56 |
assert isinstance(chatbot, ChatBotWithCookies), "在传递chatbot的过程中不要将其丢弃。必要时,可用clear将其清空,然后用for+append循环重新赋值。"
|
57 |
+
yield chatbot.get_cookies(), chatbot, history, msg
|
58 |
############################### ################## #######################################
|
59 |
##########################################################################################
|
60 |
|
|
|
340 |
return []
|
341 |
i_ask, gpt_reply = y[-1]
|
342 |
i_ask = text_divide_paragraph(i_ask) # 输入部分太自由,预处理一波
|
343 |
+
gpt_reply = close_up_code_segment_during_stream(gpt_reply) # 当代码输出半截的时候,试着补上后个```
|
|
|
344 |
y[-1] = (
|
345 |
+
None if i_ask is None else markdown.markdown(i_ask, extensions=['fenced_code', 'tables']),
|
|
|
346 |
None if gpt_reply is None else markdown_convertion(gpt_reply)
|
347 |
)
|
348 |
return y
|