Set Dimensions on Ollama Embeddings for Query #17613
Replies: 3 comments 1 reply
-
🤖 Hey @stealthier-ai, nice to see you diving deep into the bits and bytes again! 🤖 Based on the information you've provided and the context from the LangChain repository, it seems like the issue you're encountering is due to a mismatch in the dimensions of the embeddings generated by the The This discrepancy could be due to using different models or configurations for the Here's the relevant code from the LanceDB class in the LangChain repository: # In the add_texts method
embeddings = self._embedding.embed_documents(list(texts))
# In the similarity_search method
embedding = self._embedding.embed_query(query) As for the default dimension size for the For more details, you can refer to the LanceDB class in the LangChain repository: libs/community/langchain_community/vectorstores/lancedb.py Please let me know if you need further assistance or if there's anything else I can help with. Sources
|
Beta Was this translation helpful? Give feedback.
-
I hope this helps. The dimension size property is set within the model. I typically pick an embedding model, find this configuration parameter, and then create a field and an index in my vector store with this value. It might be configurable via the client |
Beta Was this translation helpful? Give feedback.
-
I found a similar unsolved discussion that might be relevant to your issue: Chromadb: InvalidDimensionException: Embedding dimension 1024 does not match collection dimensionality 384 [1]. Regarding your specific issue, it seems like there might be a mismatch in the embedding dimensions between the documents and the query. Unfortunately, I couldn't find specific information on how to set or configure the embedding dimensions for the However, you can check the following points to troubleshoot the issue:
If the issue persists, you might want to look into the specific configuration or parameters of the For more detailed documentation on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I chunked a bunch of a documents using the Ollama model embedding option and inserted the vectors into LanceDB. However, when I query the data using the same exact Ollama embedding model I receive the following error: "ValueError: Query vector size 8192 does not match index column size 384". If I am using the same exact embedding model for the documents in RAG, why is my query vector a different size than the vector in the index?
System Info
Linux Debian
Beta Was this translation helpful? Give feedback.
All reactions