feat: add api for knowledge_based QA

This commit is contained in:
wangxinkai 2023-04-18 09:55:40 +08:00
parent 3eaa25c9ba
commit 5a0429b2af
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,9 @@ VECTOR_SEARCH_TOP_K = 6
LLM_HISTORY_LEN = 3 LLM_HISTORY_LEN = 3
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 7cc03c3 (feat: add api for knowledge_based QA)
def load_file(filepath): def load_file(filepath):
if filepath.lower().endswith(".pdf"): if filepath.lower().endswith(".pdf"):
@ -30,8 +33,11 @@ def load_file(filepath):
docs = loader.load_and_split(text_splitter=textsplitter) docs = loader.load_and_split(text_splitter=textsplitter)
return docs return docs
<<<<<<< HEAD
======= =======
>>>>>>> cba44ca (修复 webui.py llm_history_len vector_search_top_k 显示值与启动设置默认值不一致的问题) >>>>>>> cba44ca (修复 webui.py llm_history_len vector_search_top_k 显示值与启动设置默认值不一致的问题)
=======
>>>>>>> 7cc03c3 (feat: add api for knowledge_based QA)
class LocalDocQA: class LocalDocQA:
llm: object = None llm: object = None