刷页面loading 不做多操作,优化刷新页面时抖动的情况,搜索prompt大小写适配

This commit is contained in:
w_xiaolizu
2023-06-12 19:07:12 +08:00
parent ac7d82380a
commit b3f9566d19
3 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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'), ''

View File

@ -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不会走这里