Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dspy): fix save/load for predict method #1046

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GFarnon
Copy link

@GFarnon GFarnon commented May 20, 2024

Allow the dump_state/load_state methods in dspy.Predict to include prefix and desc for all signature fields

@okhat
Copy link
Collaborator

okhat commented May 20, 2024

Thank you so much @GFarnon ! If I understand correctly, this will not be backwards compatible with existing saved files?

@okhat
Copy link
Collaborator

okhat commented May 20, 2024

Also looks like the ruff check is failing but that's more minor.

@GFarnon
Copy link
Author

GFarnon commented May 20, 2024

Will add a fallback & fix

@arnavsinghvi11
Copy link
Collaborator

Hi @GFarnon , thanks for the PR! the ruff fix will be fixed once you merge with main.

@okhat I've tested the change with the intro.ipynb and it doesn't have any breaking changes - although it does not rely on save/load functionalities. Would the CoT.ipynb be better to test this (although that does not have cache currently so it wouldn't break any repo-wide changes).

@GFarnon would this change impact ChainOfThought as well, given that there are extended_... fields added to the state? For context, ChainOfThought inherits from Predict but reconstructs the signature within its internals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants