fix faiss vector error

This commit is contained in:
wvivi2023 2024-03-01 14:04:27 +08:00
parent bac5b22879
commit df993defcc
3 changed files with 7 additions and 6 deletions

View File

@ -50,8 +50,7 @@ class ESKBService(KBService):
}
self.es_client_python.indices.create(index=self.index_name, mappings=mappings)
except BadRequestError as e:
logger.error("创建索引失败,重新")
logger.error(e)
logger.error("创建索引失败,重新" + e)
try:
# langchain ES 连接、创建索引

View File

@ -114,6 +114,8 @@ class FaissKBService(KBService):
else:
return False
def searchbyContent(self):
pass
if __name__ == '__main__':
faissService = FaissKBService("test")

View File

@ -315,9 +315,9 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
time.sleep(1)
st.rerun()
with st.sidebar:
keyword = st.text_input("查询关键字")
top_k = st.slider("匹配条数", 1, 100, 3)
# with st.sidebar:
# keyword = st.text_input("查询关键字")
# top_k = st.slider("匹配条数", 1, 100, 3)
# st.write("文件内文档列表。双击进行修改,在删除列填入 Y 可删除对应行。")
# docs = []