From c564c91a820de996c0cb64e01bf631858be646b6 Mon Sep 17 00:00:00 2001 From: kztao Date: Tue, 11 Jul 2023 19:18:24 +0800 Subject: [PATCH] fix:The knowledge base name cannot be empty. (#793) * fix:The knowledge base name cannot be empty. * Update webui.py --------- Co-authored-by: imClumsyPanda --- webui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 0a96e4c..69962d2 100644 --- a/webui.py +++ b/webui.py @@ -218,7 +218,12 @@ def change_chunk_conent(mode, label_conent, history): def add_vs_name(vs_name, chatbot): - if vs_name in get_vs_list(): + if vs_name is None or vs_name.strip() == "" : + vs_status = "知识库名称不能为空,请重新填写知识库名称" + chatbot = chatbot + [[None, vs_status]] + return gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update( + visible=False), chatbot, gr.update(visible=False) + elif vs_name in get_vs_list(): vs_status = "与已有知识库名称冲突,请重新选择其他名称后提交" chatbot = chatbot + [[None, vs_status]] return gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(