ValueError: Expected EmbeddingFunction.__call__ to have the following signature

报错信息
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
chroma.ipynb Cell 15 line 1
----> 1 vectorstore = Chroma.from_documents(
2 split_docs, embeddings)
File ~/anaconda3/envs/torch/lib/python3.9/site-packages/langchain/vectorstores/chroma.py:612, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
610 texts = [doc.page_content for doc in documents]
611 metadatas = [doc.metadata for doc in documents]
–> 612 return cls.from_texts(
613 texts=texts,
614 embedding=embedding,
615 metadatas=metadatas,
616 ids=ids,
617 collection_name=collection_name,
618 persist_directory=persist_directory,
619 client_settings=client_settings,
620 client=client,
621 collection_metadata=collection_metadata,
622 **kwargs,
623 )

File ~/anaconda3/envs/torch/lib/python3.9/site-packages/langchain/vectorstores/chroma.py:567, in Chroma.from_texts(cls, texts, embedding, metadatas, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
534 @classmethod
535 def from_texts(

ValueError: Expected EmbeddingFunction.__call__ to have the following signature: odict_keys([‘self’, ‘input’]), got odict_keys([‘self’, ‘args’, ‘kwargs’])
Please see https://docs.trychroma.com/embeddings for details of the EmbeddingFunction interface.
Please note the recent change to the EmbeddingFunction interface: https://docs.trychroma.com/migration#migration-to-0416—november-7-2023
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings…

解决办法

GitHub issues: 错误详情 https://github.com/langchain-ai/langchain/issues/13051

pip install chromadb==0.4.15

你可能感兴趣的:(langchain,langchain,chatgpt)