Find answers from the community

Updated 8 months ago

Hi,

Hi,
I am trying to query a VectorStoreindex which I have created using Gemini,
Plain Text
 query_engine = index.as_query_engine(llm=Settings.llm, similarity_top_k=5)


but facing the following issue
Plain Text
 
shapes (1536,) and (768,) not aligned: 1536 (dim 0) != 768 (dim 0)


I figured that I might have to use Gemini to load the indexes well, but enable to pass it while using
Plain Text
storage_context = StorageContext.from_defaults(persist_dir=path)
load_index_from_storage(storage_context)

Can anyone please suggest me how to do the same. Thanks in advance.
L
s
2 comments
you need to use the same embed model to query the index as you used to create the index

You can set Settings.embed_model or pass it in load_index_from_storage(..., embed_model=embed_model)
Add a reply
Sign up and join the conversation on Discord