-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Introduce dspy.Refine
, dspy.BestOfN
and fix thread safety for dspy.ChainOfThoughtWithHint
#1959
Conversation
a1a6bb2
to
a8e3f19
Compare
I'm really interested in this... I mean in terms of specs! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool PR!
A project I am working on used to leverage the dspy.Suggest/Assert functionality (before the recent deprecation), and this looks like an amazing substitute.
I added some comments/feedback/questions, which I hope will help in building this. Let me know if I can be of service :D
@zbambergerNLP Thanks for your comments! Usually we don't recommend community dropping comments on PR, a much better way to contribute is trying this API out in your workflow, and let us know what's good/bad (ideally with a colab link for reproducing). We will have this API merged and released in 1-2 weeks, stay tuned! |
Thanks a lot @zbambergerNLP ! @chenmoneygithub , @zbambergerNLP is not just a community member, he's been building some cool things in the broader team :D |
dspy/refine/refine.py
Outdated
# last_trace. | ||
predict.forward = MethodType(partial_forward, predict) | ||
|
||
def _undo_patch_predict_call_with_feedback(self, named_predicts): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this is not thread safe
dspy.Refine
dspy.Refine
, dspy.BestOfN
and fix thread safety for dspy.ChainOfThoughtWithHint
…into pr/chenmoneygithub/1959
dspy.Refine
is a new API we are adding to support feedback-based retry. More details coming soon.