Commit 5caee02e by 文靖昊

fix function get_similarity_doc bug

parent ec3277e8
...@@ -321,6 +321,8 @@ def get_similarity_doc(similarity_doc_hash: str): ...@@ -321,6 +321,8 @@ def get_similarity_doc(similarity_doc_hash: str):
txt_doc = TxtDoc(k_db) txt_doc = TxtDoc(k_db)
for h in hashs: for h in hashs:
doc = txt_doc.search(h) doc = txt_doc.search(h)
if doc is None:
continue
d = Document(page_content=doc[0],metadata=json.loads(doc[1])) d = Document(page_content=doc[0],metadata=json.loads(doc[1]))
docs.append(d) docs.append(d)
return docs_to_json(docs) return docs_to_json(docs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment