diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f15f07e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,12 @@ +langchain>=0.0.124 +transformers==4.27.1 +unstructured[local-inference] +layoutparser[layoutmodels,tesseract] +nltk +sentence-transformers +beautifulsoup4 +icetk +cpm_kernels +faiss-cpu +gradio>=3.25.0 +detectron2@git+https://github.com/facebookresearch/detectron2.git@v0.6#egg=detectron2 \ No newline at end of file diff --git a/webui.py b/webui.py index cf82075..b81c698 100644 --- a/webui.py +++ b/webui.py @@ -59,6 +59,10 @@ def reinit_model(llm_model, embedding_model, llm_history_len, top_k): top_k=top_k), +def get_vector_store(filepath): + local_doc_qa.init_knowledge_vector_store("content/"+filepath) + + model_status = gr.State() history = gr.State([]) vs_path = gr.State() @@ -141,12 +145,12 @@ with gr.Blocks(css=""" file.upload(upload_file, inputs=file, outputs=selectFile) - # load_button.click(local_doc_qa.init_knowledge_vector_store, - # show_progress=True, - # api_name="init_knowledge_vector_store", - # inputs=selectFile, - # outputs=vs_path - # ).then( + load_button.click(get_vector_store, + show_progress=True, + api_name="init_knowledge_vector_store", + inputs=selectFile, + outputs=vs_path + )#.then( # get_file_status, # chatbot, # chatbot,