Find answers from the community

Updated 3 months ago

i am having issues issues with index.as_

i am having issues issues with index.as_query_engine() in runner.aevaluate_queries
i get this error
Attachment
image.png
i
L
11 comments
started on version 0.10.XX
seems like an issue coming from index.as_query_engine()
seems to be related to Faisss
result = func(*args, kwargs) File "/Users/ilpinto/dev/lightspeed-rag-content/.conda/lib/python3.10/site-packages/llama_index/core/indices/vector_store/retrievers/retriever.py", line 101, in _retrieve return self._get_nodes_with_embeddings(query_bundle) File "/Users/ilpinto/dev/lightspeed-rag-content/.conda/lib/python3.10/site-packages/llama_index/core/indices/vector_store/retrievers/retriever.py", line 177, in _get_nodes_with_embeddings query_result = self._vector_store.query(query, self._kwargs)
File "/Users/ilpinto/dev/lightspeed-rag-content/.conda/lib/python3.10/site-packages/llama_index/vector_stores/faiss/base.py", line 182, in query
dists, indices = self._faiss_index.search(
File "/Users/ilpinto/dev/lightspeed-rag-content/.conda/lib/python3.10/site-packages/faiss/class_wrappers.py", line 329, in replacement_search
assert d == self.d
AssertionError
The issue seems to come from loading the faiss vector store
@Logan M any idea?
Seems like dimensions do not match
So the dimenions of the faise store don't match the dimensions of the model you are using to query
you have to make sure you query with the same embedding model that you used to create the index
@Logan M
i am loading the model from persist dir. like this

load index from disk

vector_store = FaissVectorStore.from_persist_dir(PRODUCT_DOCS_PERSIST_DIR)
storage_context = StorageContext.from_defaults(
vector_store=vector_store, persist_dir=PRODUCT_DOCS_PERSIST_DIR
)
index = load_index_from_storage(storage_context=storage_context,index_id="4.15")

as far as I see there is no dimensions variable
The dimensions come from the embedding model -- the error meant that you aren't using the same embedding model to query that you used to build the index
Add a reply
Sign up and join the conversation on Discord