Find answers from the community

s
F
Y
a
P
Updated last year

Saving loading

Is there an example showing the proper way for saving / loading several GPTVectorStoreIndex indices (each txt file should have an associated index)?
In the older version there was a single json per index but now it's more complicated and I'm not sure how to have multiple indices
L
y
7 comments
Instead of each index having a json file, each index has a folder with up to 3 files in it

You can just call index.storage_context.persist(persist_dir="my_index") for each index you want to save (with a different name for each of course)
Thanks @Logan M, that's a possible solution that would create a folder per index. I guess if I want to put them all in the same folder I should set a different name for the doc store, index store and vector store
I thiiink so. I think you can also set an index ID (and also specify the ID when you load) and share the docstore and vector store.. at least I thought I saw that somewhere in the docs lol
They seem to load multiple indexes at once there
You can set the index id before saving with index.set_index_id('my index')
Great thanks πŸ™‚
Add a reply
Sign up and join the conversation on Discord