Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
π
π
π
Powered by
Hall
Inactive
Updated 3 months ago
0
Follow
Hey I have a problem of saving
Hey I have a problem of saving
Inactive
0
Follow
R
Rena
last year
Β·
Hey. I have a problem of saving composable graph into disk and load it. I wonder if anyone has the solution for this
L
R
21 comments
Share
Open in Discord
L
Logan M
last year
It's a tad janky.
All sub-indexes should share the same storage context object.
Then you can just call persist on the root
https://gpt-index.readthedocs.io/en/latest/core_modules/data_modules/index/composability.html#optional-persisting-the-graph
R
Rena
last year
Attachment
R
Rena
last year
Thank you for helping me out. The problem is that I have been doing the same, but still got the problem
L
Logan M
last year
Are you able to share the code for this?
R
Rena
last year
I can share a partial of it
L
Logan M
last year
We have a unit-test in the code for saving-loading a graph, it may also be helpful
https://github.com/jerryjliu/llama_index/blob/main/tests/indices/test_loading_graph.py
R
Rena
last year
Attachments
R
Rena
last year
Thank you. I appreciate that!
L
Logan M
last year
rather than setting the ID attribute directly, maybe try using the setter instead.
graph.root_index.set_index_id("my_id")
Also, just double checking that all subindexes are sharing the same storage context? π€
I realize this is pretty janky. It's actually a task for this week to make this a little smoother π
R
Rena
last year
Yes, they all share the same storage_context
R
Rena
last year
Haha. thank you for your effort in developing this for a better
R
Rena
last year
I wonder if there is a remote storage for this, so that i don't need to rely on file system
R
Rena
last year
Oops I still got the same issue even though i already use this graph.root_index.set_index_id
R
Rena
last year
Attachment
R
Rena
last year
here is the index.json in the storage
L
Logan M
last year
You can change the backend using fsspec, to use amazon s3 for example
https://gpt-index.readthedocs.io/en/latest/core_modules/data_modules/storage/save_load.html#using-a-remote-backend
L
Logan M
last year
I'm very confused why this isn't working π€
L
Logan M
last year
Writing a full example to confirm it works haha
R
Rena
last year
would it be alright if i could dm you and share the code ? it maybe the case that my logic has the problem
L
Logan M
last year
yea go for it π
R
Rena
last year
oh I see. thank you.
Add a reply
Sign up and join the conversation on Discord
Join on Discord