Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chromadb + Langchain + SentenceTransformerEmbeddingFunction throwing 'SentenceTransformerEmbeddingFunction' object has no attribute 'embed_documents'

I have been trying to use

  • Chromadb version 0.4.8
  • Langchain version 0.0.276

with SentenceTransformerEmbeddingFunction as shown in the snippet below.

from langchain.vectorstores import Chroma
from chromadb.utils import embedding_functions

# other imports
embedding = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")

However, it throws the following error.

AttributeError: 'SentenceTransformerEmbeddingFunction' object has no attribute 'embed_documents'

Would appreciate any help. Thank you.

like image 629
Sanjay Avatar asked Oct 24 '25 05:10

Sanjay


1 Answers

Your error irrelevant with code that you provided. I am on same versions with you but this works for me, maybe your usage of embedding variable can cause this error.

enter image description here

Can you please provide full code.

like image 169
Servet Can Gürsel Avatar answered Oct 27 '25 00:10

Servet Can Gürsel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!