Find answers from the community

Updated last year

Hello, I have a basic question because I

At a glance

The community member is trying to use ChromaDB with Docker and is having trouble understanding why they need to use "documents" in the last line of their code. The comments suggest that if the documents are already set up in ChromaDB, they can use VectorStoreIndex.from_vector_store(vector_store=vector_store) instead. The comments also explain that from_documents is used when adding documents to the vector store through llama_index. The community member encountered an error related to embedding dimensions, but was able to resolve the issue by changing the embed_model of llama_index.

Useful resources
Hello, I have a basic question because I am not understanding something. I'm trying to use chromadb with docker:

import chromadb remote_db = chromadb.HttpClient() chroma_collection = remote_db.get_or_create_collection("quickstart") vector_store = ChromaVectorStore(chroma_collection=chroma_collection) storage_context = StorageContext.from_defaults(vector_store=vector_store) service_context = ServiceContext.from_defaults(embed_model=embed_model) index = VectorStoreIndex.from_documents( documents, storage_context=storage_context, service_context=service_context )
This is the code I want to make it work. I am creating a chromadb collection in one backend where the documents are allocated.
From other backend I want to create this index and make querys.
My question is, why I need to use documents in the last line of the code??
Chromadb doesn't save this data with the related vector???
E
e
8 comments
If you already have your documents setup on chrome db you can do:

Plain Text
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)
index = VectorStoreIndex.from_vector_store(vector_store=vector_store)
from_documents is when you want to add the documents to the vector store through llama_index using like SimpleDirectoryReader or a Llamahub reader
Yess I try that but I got: Error: Embedding dimension 1536 does not match collection dimensionality 384
I am always using always the default embeddings from chroma that is all-MiniLM-L6-v2
Now I am changing the embed_model of llama_index I think that after that everithing is going to be fine
yess I found the same thread. I am with some disk usage problems now to install torch and some packages, If I have another doubt I am going to put it here
Thankssss @Emanuel Ferreira
That worked fine!
Add a reply
Sign up and join the conversation on Discord