Skip to content

Checkpoints are not serializable/deserializable (?) #18265

Closed Answered by InAnYan
InAnYan asked this question in Q&A
Discussion options

You must be logged in to vote

I'm terribly sorry.

Pydantic model_dump doesn't serialize as I expected.

More information here: pydantic/pydantic#8213.

Closing, as this problem is not relevant to LlamaIndex.

Correct way of serializing/deserializing Context:

from llama_index.core.workflow import JsonPickleSerializer, JsonSerializer

ctx_dict = ctx.to_dict(serializer=JsonSerializer())

restored_ctx = Context.from_dict(
    workflow, ctx_dict, serializer=JsonSerializer()
)

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@InAnYan
Comment options

Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by InAnYan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant