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) self.es_client_python.indices.create(index=self.index_name, mappings=mappings)
except BadRequestError as e: except BadRequestError as e:
logger.error("创建索引失败,重新") logger.error("创建索引失败,重新" + e)
logger.error(e)
try: try:
# langchain ES 连接、创建索引 # langchain ES 连接、创建索引

View File

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

View File

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