We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a756618 commit 880d63bCopy full SHA for 880d63b
dspy/primitives/module.py
@@ -48,6 +48,19 @@ def __init__(self, callbacks=None):
48
# LM calling history of the module.
49
self.history = []
50
51
+ def __getstate__(self):
52
+ state = self.__dict__.copy()
53
+ state.pop("history", None)
54
+ state.pop("callbacks", None)
55
+ return state
56
+
57
+ def __setstate__(self, state):
58
+ self.__dict__.update(state)
59
+ if not hasattr(self, "history"):
60
+ self.history = []
61
+ if not hasattr(self, "callbacks"):
62
+ self.callbacks = []
63
64
@with_callbacks
65
def __call__(self, *args, **kwargs):
66
caller_modules = settings.caller_modules or []
0 commit comments