From b3f9566d1908148c43b31bd559922d1a7a54772e Mon Sep 17 00:00:00 2001 From: w_xiaolizu Date: Mon, 12 Jun 2023 19:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E9=A1=B5=E9=9D=A2loading=20=E4=B8=8D?= =?UTF-8?q?=E5=81=9A=E5=A4=9A=E6=93=8D=E4=BD=9C=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=E6=97=B6=E6=8A=96=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=EF=BC=8C=E6=90=9C=E7=B4=A2prompt?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/assets/custom.css | 3 +++ func_box.py | 5 +++-- request_llm/bridge_chatgpt.py | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/assets/custom.css b/docs/assets/custom.css index 81df50c..f942c6a 100644 --- a/docs/assets/custom.css +++ b/docs/assets/custom.css @@ -43,6 +43,9 @@ textarea { max-height: 75vh !important; /* overflow: auto !important; */ z-index: 2; + transform: translateZ(0) !important; + backface-visibility: hidden !important; + will-change: transform !important; } #prompt_result{ height: 60vh !important; diff --git a/func_box.py b/func_box.py index 1e1c8db..155f8f6 100644 --- a/func_box.py +++ b/func_box.py @@ -278,7 +278,7 @@ def diff_list(txt='', percent=0.70, switch: list = None, lst: list = None, sp=15 dateset_list = [] for key in sorted_dict: # 开始匹配关键字 - index = key[0].find(txt) + index = str(key[0]).lower().find(txt.lower()) if index != -1: # sp=split 用于判断在哪里启动、在哪里断开 if index - sp > 0: @@ -485,11 +485,12 @@ def reuse_chat(result, chatbot, history, pro_numb): pass else: if pro_numb: - chatbot.append(result) + chatbot += result history += [pattern_markdown.sub('', _) for i in result for _ in i] else: chatbot.append(result[-1]) history += [pattern_markdown.sub('', _) for i in result[-2:] for _ in i] + print(chatbot[-1][0]) i_say = pattern_markdown.sub('', chatbot[-1][0]) return chatbot, history, i_say, gr.Tabs.update(selected='chatbot'), '' diff --git a/request_llm/bridge_chatgpt.py b/request_llm/bridge_chatgpt.py index bb21e3f..cfca56a 100644 --- a/request_llm/bridge_chatgpt.py +++ b/request_llm/bridge_chatgpt.py @@ -168,8 +168,6 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp stream_response = response.iter_lines() while True: try: - loading_msg = func_box.spinner_chatbot_loading(chatbot) - yield from update_ui(chatbot=loading_msg, history=history) chunk = next(stream_response) except StopIteration: # 非OpenAI官方接口的出现这样的报错,OpenAI和API2D不会走这里