# Langchain & SentenceTransformerEmbeddings error while passing the embeded function to chromadb

**URL:** <https://discuss.huggingface.co/t/langchain-sentencetransformerembeddings-error-while-passing-the-embeded-function-to-chromadb/80379>\
**Category:** 🤗Transformers\
**Created:** [April 5, 2024, 8:26pm UTC](https://discuss.huggingface.co/t/langchain-sentencetransformerembeddings-error-while-passing-the-embeded-function-to-chromadb/80379 "2024-04-05T20:26:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mithun794](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mithun794](https://discuss.huggingface.co/u/Mithun794)\
**Post date:** [April 5, 2024, 8:26pm UTC](https://discuss.huggingface.co/t/langchain-sentencetransformerembeddings-error-while-passing-the-embeded-function-to-chromadb/80379/1 "2024-04-05T20:26:27Z")

</div>

Below is the code snippet which i am trying to run

```auto
from langchain.vectorstores.chroma import Chroma
from langchain.text_splitter import CharacterTextSplitter
from langchain_community.document_loaders import JSONLoader
from langchain_community.embeddings.sentence_transformer import SentenceTransformerEmbeddings
persistent_directory = 'db'
try:
     
     loader = JSONLoader(
      file_path='./data/abc.json',
      jq_schema='.',
      text_content=False)
     
     data = loader.load()

     text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
     text = text_splitter.split_documents(data)

     embedding_function = SentenceTransformerEmbeddings(model_name="paraphrase-MiniLM-L6-v2")

     vectordb = Chroma.from_documents(text, embedding_function)
    
except Exception as e:
    print("Error: ", e)

```

Error : Error: Expected EmbeddingFunction. **call** to have the following signature: odict\_keys([‘self’, ‘input’]), got odict\_keys([‘args’, ‘kwargs’])  
Please see [🧬 Embeddings | Chroma](https://docs.trychroma.com/embeddings) for details of the EmbeddingFunction interface.  
Please note the recent change to the EmbeddingFunction interface: [✈️ Migration | Chroma](https://docs.trychroma.com/migration#migration-to-0416---november-7-2023)

Could someone help me here
