Find answers from the community

Updated 9 months ago

Hi, I'm trying to do multi-modal RAG

Hi, I'm trying to do multi-modal RAG like this:

Plain Text
text_store = LanceDBVectorStore(uri="lancedb", table_name="text_collection")
image_store = LanceDBVectorStore(uri="lancedb", table_name="image_collection")
storage_context = StorageContext.from_defaults(
    vector_store=text_store, image_store=image_store
)
index = MultiModalVectorStoreIndex.from_vector_store(
    vector_store=text_store,
    embed_model=HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5"), # dim = 1024
    image_vector_store=image_store,
    image_embed_model=ClipEmbedding(model_name="ViT-L/14") # dim = 768
)
retriever_engine = index.as_retriever(
    similarity_top_k=2, image_similarity_top_k=2
)

But when I do retrieval, it raises ValueError: Query vector size 1024 does not match index column size 768

How can I modify the dimension for each vector store? I can't find the args for that. Thanks in advance.
L
s
11 comments
do you have the full traceback? It should be using clip for image retrieval, and BAAI for text retrieval
I don't because I just switch to use QdrantVectorStore. And yes I used clip and BAAI.
But it works when using Qdrant somehow
I"m using the same code, just change the VectorStoreIndex to Qdrant
yea not really sure on that one πŸ€” maybe a lancedb limitation?
But why most VectorStore doesn't have the argument to set embed_dim like PGVectorStore?
That argument is very useful to me
I think most dont need it actually, it gets handled magically by the vector db
The error above you got originally tells me that the wrong model was used to embed and query the collection, there was some mismatch somehow
Add a reply
Sign up and join the conversation on Discord