From 7a63b2c1140c72d141ce7ed07a313db5200aad4c Mon Sep 17 00:00:00 2001 From: yanqiangmiffy <1185918903@qq.com> Date: Thu, 20 Apr 2023 02:54:56 +0800 Subject: [PATCH] update@todo --- app.py | 7 ++----- main.py | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 518e482..7c86494 100644 --- a/app.py +++ b/app.py @@ -1,7 +1,6 @@ import os import shutil -from app_modules.overwrites import postprocess from app_modules.presets import * from clc.langchain_application import LangChainApplication @@ -50,6 +49,7 @@ def set_knowledge(kg_name, history): application.source_service.load_vector_store(config.kg_vector_stores[kg_name]) msg_status = f'{kg_name}知识库已成功加载' except Exception as e: + print(e) msg_status = f'{kg_name}知识库未成功加载' return history + [[None, msg_status]] @@ -145,10 +145,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo: value='模型问答', interactive=True) - kg_name = gr.Radio(['中文维基百科', - '大规模金融研报知识图谱', - '初始化知识库' - ], + kg_name = gr.Radio(list(config.kg_vector_stores.keys()), label="知识库", value=None, info="使用知识库问答,请加载知识库", diff --git a/main.py b/main.py index c656294..3232705 100644 --- a/main.py +++ b/main.py @@ -50,6 +50,7 @@ def set_knowledge(kg_name, history): application.source_service.load_vector_store(config.kg_vector_stores[kg_name]) msg_status = f'{kg_name}知识库已成功加载' except Exception as e: + print(e) msg_status = f'{kg_name}知识库未成功加载' return history + [[None, msg_status]] @@ -145,10 +146,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo: value='模型问答', interactive=True) - kg_name = gr.Radio(['中文维基百科', - '大规模金融研报知识图谱', - '初始化知识库' - ], + kg_name = gr.Radio(list(config.kg_vector_stores.keys()), label="知识库", value=None, info="使用知识库问答,请加载知识库",