Attribute Error: 'TreeIndex' object has no attribute 'persist.'
index.storage_context.persist(...)
from llama_index import load_index_from_storage, StorageContext storage_context = StorageContext.from_defaults(...) index = load_index_from_storage(storage_context, service_context=service_context)
persist_dir
to from defaultsstorage_context = StorageContext.from_defaults(persist_dir="./storage")
index = load_index_from_storage(storage_context, service_context=service_context)