fix:The knowledge base name cannot be empty. (#793)

* fix:The knowledge base name cannot be empty.

* Update webui.py

---------

Co-authored-by: imClumsyPanda <littlepanda0716@gmail.com>
This commit is contained in:
kztao 2023-07-11 19:18:24 +08:00 committed by GitHub
parent 80af725a41
commit c564c91a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -218,7 +218,12 @@ def change_chunk_conent(mode, label_conent, history):
def add_vs_name(vs_name, chatbot): 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 = "与已有知识库名称冲突,请重新选择其他名称后提交" vs_status = "与已有知识库名称冲突,请重新选择其他名称后提交"
chatbot = chatbot + [[None, vs_status]] chatbot = chatbot + [[None, vs_status]]
return gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update( return gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(