Find answers from the community

Updated last year

Is it possible to persist storage for

Is it possible to persist storage for instances of ObjectIndex please?
Plain Text
    storage_context = StorageContext.from_defaults()

    obj_index = ObjectIndex.from_objects(
        table_schema_objs,
        table_node_mapping,
        VectorStoreIndex,
        storage_context=storage_context,
    )

    storage_context.persist(persist_dir=persist_dir)
L
2 comments
It is I think.... but it's extremely hacky

Adding a ticket to our board to better support saving/loading these things
You could access obj_index._index.storage_context and persist from there. And then load the index and pass it into the class constructor

But that doesn't handle the object node mapping πŸ€”
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord