(Chroma): Small Fix in add_texts when checking for embeddings (#29766)

- **Description:** Small fix in `add_texts` to make embedding
nullability is checked properly.
- **Issue:** #29765

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Mohammad Mohtashim 2025-02-13 07:26:13 +05:00 committed by GitHub
parent 716fd89d8e
commit 2310847c0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -547,7 +547,9 @@ class Chroma(VectorStore):
metadatas = [metadatas[idx] for idx in non_empty_ids] metadatas = [metadatas[idx] for idx in non_empty_ids]
texts_with_metadatas = [texts[idx] for idx in non_empty_ids] texts_with_metadatas = [texts[idx] for idx in non_empty_ids]
embeddings_with_metadatas = ( embeddings_with_metadatas = (
[embeddings[idx] for idx in non_empty_ids] if embeddings else None [embeddings[idx] for idx in non_empty_ids]
if embeddings is not None
else None
) )
ids_with_metadata = [ids[idx] for idx in non_empty_ids] ids_with_metadata = [ids[idx] for idx in non_empty_ids]
try: try: