Skip to content

Commit

Permalink
community[patch]: Revert " Fix the bug that Chroma does not specify `…
Browse files Browse the repository at this point in the history
…e… (#19866)

…mbedding_function` (#19277)"

This reverts commit 7042934.

Fixes #19848
  • Loading branch information
baskaryan committed Apr 1, 2024
1 parent f06229b commit d62e84c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions libs/community/langchain_community/vectorstores/chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import chromadb.config
from chromadb.api.types import ID, OneOrMany, Where, WhereDocument


logger = logging.getLogger()
DEFAULT_K = 4 # Number of Documents to return.

Expand Down Expand Up @@ -81,7 +80,6 @@ def __init__(
try:
import chromadb
import chromadb.config
from chromadb.utils import embedding_functions
except ImportError:
raise ImportError(
"Could not import chromadb python package. "
Expand Down Expand Up @@ -124,12 +122,10 @@ def __init__(
_client_settings.persist_directory or persist_directory
)

self._embedding_function = (
embedding_function or embedding_functions.DefaultEmbeddingFunction()
)
self._embedding_function = embedding_function
self._collection = self._client.get_or_create_collection(
name=collection_name,
embedding_function=self._embedding_function,
embedding_function=None,
metadata=collection_metadata,
)
self.override_relevance_score_fn = relevance_score_fn
Expand Down

0 comments on commit d62e84c

Please sign in to comment.