LlamaIndex-readme-7.py
· 229 B · Python
Raw
from llama_index.core import StorageContext, load_index_from_storage
# rebuild storage context
storage_context = StorageContext.from_defaults(persist_dir="./storage")
# load index
index = load_index_from_storage(storage_context)
1 | from llama_index.core import StorageContext, load_index_from_storage |
2 | |
3 | # rebuild storage context |
4 | storage_context = StorageContext.from_defaults(persist_dir="./storage") |
5 | # load index |
6 | index = load_index_from_storage(storage_context) |