mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
ed9fbe153b
commit
48e7f47558
1 changed files with 2 additions and 2 deletions
|
|
@ -645,7 +645,7 @@ def save_docs_to_vector_db(
|
||||||
filter={"hash": metadata["hash"]},
|
filter={"hash": metadata["hash"]},
|
||||||
)
|
)
|
||||||
|
|
||||||
if result:
|
if result is not None:
|
||||||
existing_doc_ids = result.ids[0]
|
existing_doc_ids = result.ids[0]
|
||||||
if existing_doc_ids:
|
if existing_doc_ids:
|
||||||
log.info(f"Document with hash {metadata['hash']} already exists")
|
log.info(f"Document with hash {metadata['hash']} already exists")
|
||||||
|
|
@ -767,7 +767,7 @@ def process_file(
|
||||||
collection_name=f"file-{file.id}", filter={"file_id": file.id}
|
collection_name=f"file-{file.id}", filter={"file_id": file.id}
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(result.ids[0]) > 0:
|
if result is not None and len(result.ids[0]) > 0:
|
||||||
docs = [
|
docs = [
|
||||||
Document(
|
Document(
|
||||||
page_content=result.documents[0][idx],
|
page_content=result.documents[0][idx],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue