so i recently started to work on chromabd and i am facing this error: "module 'chromadb' has no attribute 'config'"
here is my code:
from langchain.vectorstores import Chroma
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
#Sentences are encoded by calling model.encode()
embeddings = [model.encode(text[i].page_content) for i in range(len(text))]
presist_directory = 'db'
vectordb = Chroma.from_documents(documents=text,embedding=embeddings,persist_directory=presist_directory)
- i have already tried down versioning chromadb
- tried this solution:
from langchain.indexes import VectorstoreIndexCreator
from langchain.vectorstores import Chroma
presist_directory = 'db'
vectordb = VectorstoreIndexCreator().from_documents(
documents=text,
embedding=embeddings,
persist_directory=presist_directory,
vectorstore_cls=Chroma,
)
- and tried this solution too:
import chromadb
# Get the version of ChromaDB
chroma_version = chromadb.__version__
# Check if the version is 0.4 or later
if float(chroma_version[:3]) >= 0.4:
# Use the new configuration
_client_settings = chromadb.config.Settings(
chroma_db_impl="new_configuration",
persist_directory=persist_directory,
)
else:
# Use the old configuration
_client_settings = chromadb.config.Settings(
chroma_db_impl="duckdb+parquet",
persist_directory=persist_directory,
)