Find answers from the community

Updated 4 months ago

Hello everyone,

At a glance
Hello everyone,
Until now I had a simple script that worked very well, simply using :
index = load_index_from_storage( StorageContext.from_defaults(persist_dir="./citation"), )

Then :

response = index.as_query_engine(llm=llm).query( my_query )

However, now I systematically get an error:

File ".../python3.9/site-packages/llama_index/core/base/embeddings/base.py", line 57, in similarity product = np.dot(embedding1, embedding2) ValueError: shapes (1536,) and (3072,) not aligned: 1536 (dim 0) != 3072 (dim 0)


However, I tried to redo the source indexing by deleting the ./citation directory and redoing the following command, but with no success :
documents = SimpleDirectoryReader("./data").load_data() index = VectorStoreIndex.from_documents( documents, ) index.storage_context.persist(persist_dir="./citation")
W
n
2 comments
Delete the citation folder one more time and set this at the top:
Plain Text
from llama_index.core import Settings
Settings.embed_model = YOUR_embed_model_here


Try with this once
It works, thank you. But I had to create a new folder with a new name, deleting the "quote" folder wasn't enough...
Add a reply
Sign up and join the conversation on Discord