update@todo
This commit is contained in:
parent
e81ef864e9
commit
7a63b2c114
7
app.py
7
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="使用知识库问答,请加载知识库",
|
||||
|
|
6
main.py
6
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="使用知识库问答,请加载知识库",
|
||||
|
|
Loading…
Reference in New Issue