Find answers from the community

Updated 3 months ago

Hi

Hi
I have loaded index from storage using :

index = load_index_from_storage(storage_context)
and then initiated a query engine

however when trying to use query engine:
egnine = index.as_query_engine(service_context=service_context)
egnine.query("What are deployment strategies used for in application development?")

i am getting the following error


File /opt/app-root/lib64/python3.9/site-packages/llama_index/embeddings/base.py:48, in similarity(embedding1, embedding2, mode)
46 return np.dot(embedding1, embedding2)
47 else:
---> 48 product = np.dot(embedding1, embedding2)
49 norm = np.linalg.norm(embedding1) * np.linalg.norm(embedding2)
50 return product / norm

ValueError: shapes (1536,) and (768,) not aligned: 1536 (dim 0) != 768 (dim 0)
L
1 comment
this means you indexed data with a different embedding model compared to what you are querying with

You should probably be doing index = load_index_from_storage(storage_context, service_context=service_context)
Add a reply
Sign up and join the conversation on Discord