Find answers from the community

Updated 3 months ago

HI I ve been having trouble getting the

HI, I've been having trouble getting the persist method to work - I keep getting permission denied errors. i'm able to write text files to the directory just fine, just can't save my vector_store, any suggestions?

from llama_index import SimpleDirectoryReader, VectorStoreIndex

documents = SimpleDirectoryReader(".").load_data()
index = VectorStoreIndex.from_documents(documents)

index.vector_store.persist(persist_path=".")
L
1 comment
try giving an actual directory. Also, you should persist the entire storage context

Plain Text
# saving
index.storage_context.persist(persist_dir="./storage")

# loading
from llama_index import StorageContext, load_index_from_storage
storage_context = StorageContext.from_defaults(persist_dir="./storage")
loaded_index = load_index_from_storage(storage_context)
Add a reply
Sign up and join the conversation on Discord