Don't pass EF to chroma (#13085)

- **Description:** 

Recently Chroma rolled out a breaking change on the way we handle
embedding functions, in order to support multi-modal collections.

This broke the way LangChain's `Chroma` objects get created, because we
were passing the EF down into the Chroma collection:
https://docs.trychroma.com/migration#migration-to-0416---november-7-2023

However, internally, we are never actually using embeddings on the
chroma collection - LangChain's `Chroma` object calls it instead. Thus
we just don't pass an `embedding_function` to Chroma itself, which fixes
the issue.
pull/13089/head
Anton Troynikov 11 months ago committed by GitHub
parent f15f8e01cf
commit 9f077270c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -124,9 +124,7 @@ class Chroma(VectorStore):
self._embedding_function = embedding_function
self._collection = self._client.get_or_create_collection(
name=collection_name,
embedding_function=self._embedding_function.embed_documents
if self._embedding_function is not None
else None,
embedding_function=None,
metadata=collection_metadata,
)
self.override_relevance_score_fn = relevance_score_fn

Loading…
Cancel
Save