Closed vikrantrathore closed 2 months ago
Related to the save meta changes @CShorten @arnavsinghvi11 #1370
module.dump_state()
calls param.dump_state
for all child parameters. There are a decent number of other classes that inherit from Parameter
that this needs to be applied to or to check to make sure it is only on predictors.
simple repro:
import dspy
class DumpStateRepro(dspy.Module):
def __init__(self):
self.retrieve = dspy.Retrieve(k=1)
answer_generator = DumpStateRepro()
answer_generator.save("DumpStateRepro", save_field_meta=True)
I would be in favor of reverting #1370 until this is fixed, and so this bug doesn't accidentally make it into the next DSPy version cut.
We should also 1000% have tests for this
Hey @isaacbmiller! Apologies to have missed this!
Added the feature flag argument to Retrieve
and LangChainPredict
(the other two child classes of Parameter
that I originally missed) here - https://github.com/stanfordnlp/dspy/pull/1388.
Renaming now from save_field_meta
to save_verbose
Should be resolved
Error in optimized program save. Using the given example of CompiledBaleen from https://github.com/stanfordnlp/dspy/blob/d3518d7ee9b717e816893d6dc1a875d687f88780/docs/docs/tutorials/simplified-baleen.md?plain=1#L186
Trying to save it with following code:
This results in an error in dump_state in https://github.com/stanfordnlp/dspy/blob/d3518d7ee9b717e816893d6dc1a875d687f88780/dspy/primitives/module.py#L117
Following is the error message: