You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
_pickle.PicklingError encountered when attempting to serialize BaseDoc type #1760
Hi @JoanFM ,
Yes, because this type is dynamically created. If it is not saved, it will need to be recreated the next time DocIndex(such as HnswDocumentIndex) is launched. Therefore, I must save the metadata for creating this class. So if possible, I would like to directly save this type.
Activity
JoanFM commentedon Aug 23, 2023
Hello @beidongjiedeguang,
May I ask what are you trying to do here? Here you are pickling a class, is it the intended behavior?
KenyonY commentedon Aug 23, 2023
Hi @JoanFM ,
Yes, because this type is dynamically created. If it is not saved, it will need to be recreated the next time
DocIndex(such as HnswDocumentIndex) is launched. Therefore, I must save the metadata for creating this class. So if possible, I would like to directly save this type.JoanFM commentedon Aug 24, 2023
This is the same problem as seen in Pydantic here pydantic/pydantic#4178
JoanFM commentedon Aug 24, 2023
So, a solution is to declare it with module parameter:
This works for me