修复默认知识库获取的逻辑 (#293)

This commit is contained in:
YiiSh 2023-05-10 09:30:00 +08:00 committed by GitHub
parent e8b2ddea51
commit e7f66a6be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -152,7 +152,7 @@ webui_title = """
# 🎉langchain-ChatGLM WebUI🎉 # 🎉langchain-ChatGLM WebUI🎉
👍 [https://github.com/imClumsyPanda/langchain-ChatGLM](https://github.com/imClumsyPanda/langchain-ChatGLM) 👍 [https://github.com/imClumsyPanda/langchain-ChatGLM](https://github.com/imClumsyPanda/langchain-ChatGLM)
""" """
default_vs = vs_list[0] if len(vs_list) > 1 else "为空" default_vs = vs_list[0] if len(vs_list) > 0 else "为空"
init_message = f"""欢迎使用 langchain-ChatGLM Web UI init_message = f"""欢迎使用 langchain-ChatGLM Web UI
请在右侧切换模式目前支持直接与 LLM 模型对话或基于本地知识库问答 请在右侧切换模式目前支持直接与 LLM 模型对话或基于本地知识库问答
@ -163,7 +163,7 @@ init_message = f"""欢迎使用 langchain-ChatGLM Web UI
""" """
model_status = init_model() model_status = init_model()
default_path = os.path.join(VS_ROOT_PATH, vs_list[0]) if len(vs_list) > 1 else "" default_path = os.path.join(VS_ROOT_PATH, vs_list[0]) if len(vs_list) > 0 else ""
with gr.Blocks(css=block_css) as demo: with gr.Blocks(css=block_css) as demo:
vs_path, file_status, model_status, vs_list = gr.State(default_path), gr.State(""), gr.State( vs_path, file_status, model_status, vs_list = gr.State(default_path), gr.State(""), gr.State(
@ -278,4 +278,4 @@ with gr.Blocks(css=block_css) as demo:
server_port=7860, server_port=7860,
show_api=False, show_api=False,
share=False, share=False,
inbrowser=False)) inbrowser=False))