Skip to content

Commit

Permalink
(Chroma): Small Fix in add_texts when checking for embeddings (#29766)
Browse files Browse the repository at this point in the history
- **Description:** Small fix in `add_texts` to make embedding
nullability is checked properly.
- **Issue:** #29765

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
  • Loading branch information
keenborder786 and ccurme authored Feb 13, 2025
1 parent 716fd89 commit 2310847
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/partners/chroma/langchain_chroma/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ def add_texts(
metadatas = [metadatas[idx] for idx in non_empty_ids]
texts_with_metadatas = [texts[idx] for idx in non_empty_ids]
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]
try:
Expand Down

0 comments on commit 2310847

Please sign in to comment.