From d73587481a1ca39be15d03519ce928a5f413bcfe Mon Sep 17 00:00:00 2001 From: Sourav Pradhan Date: Thu, 22 Feb 2024 23:57:47 +0530 Subject: [PATCH] Bugfix langchain_community/vectorstores/chroma.py In add_images() method: in upsert() methods we have to user b64_texts instead of normal string uris. --- libs/community/langchain_community/vectorstores/chroma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/vectorstores/chroma.py b/libs/community/langchain_community/vectorstores/chroma.py index 025212527cae1..abd64f56275e3 100644 --- a/libs/community/langchain_community/vectorstores/chroma.py +++ b/libs/community/langchain_community/vectorstores/chroma.py @@ -209,7 +209,7 @@ def add_images( empty_ids.append(idx) if non_empty_ids: metadatas = [metadatas[idx] for idx in non_empty_ids] - images_with_metadatas = [uris[idx] for idx in non_empty_ids] + images_with_metadatas = [b64_texts[idx] for idx in non_empty_ids] embeddings_with_metadatas = ( [embeddings[idx] for idx in non_empty_ids] if embeddings else None ) @@ -231,7 +231,7 @@ def add_images( else: raise e if empty_ids: - images_without_metadatas = [uris[j] for j in empty_ids] + images_without_metadatas = [b64_texts[j] for j in empty_ids] embeddings_without_metadatas = ( [embeddings[j] for j in empty_ids] if embeddings else None )