提交 7b3e7820 作者: imClumsyPanda

update cli_demo.py

上级 5f70ce19
...@@ -59,6 +59,10 @@ def reinit_model(llm_model, embedding_model, llm_history_len, top_k): ...@@ -59,6 +59,10 @@ def reinit_model(llm_model, embedding_model, llm_history_len, top_k):
top_k=top_k), top_k=top_k),
def get_vector_store(filepath):
local_doc_qa.init_knowledge_vector_store("content/"+filepath)
model_status = gr.State() model_status = gr.State()
history = gr.State([]) history = gr.State([])
vs_path = gr.State() vs_path = gr.State()
...@@ -141,12 +145,12 @@ with gr.Blocks(css=""" ...@@ -141,12 +145,12 @@ with gr.Blocks(css="""
file.upload(upload_file, file.upload(upload_file,
inputs=file, inputs=file,
outputs=selectFile) outputs=selectFile)
# load_button.click(local_doc_qa.init_knowledge_vector_store, load_button.click(get_vector_store,
# show_progress=True, show_progress=True,
# api_name="init_knowledge_vector_store", api_name="init_knowledge_vector_store",
# inputs=selectFile, inputs=selectFile,
# outputs=vs_path outputs=vs_path
# ).then( )#.then(
# get_file_status, # get_file_status,
# chatbot, # chatbot,
# chatbot, # chatbot,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论