0

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.

Sanjay
  • 363
  • 1
  • 3
  • 14
  • you can refer this https://betterprogramming.pub/building-a-question-answer-bot-with-langchain-vicuna-and-sentence-transformers-b7f80428eadc – ZKS Aug 30 '23 at 17:38

1 Answers1

0

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.