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): save and restore dsp.settings.trace in backtrack_handler() #1362

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theta-lin
Copy link
Contributor

This fixes the issue that originally, backtrack_handler() clears dsp.settings.trace, which is also used by optimizers such as BootstrapFewShot.

Also some ruff linting of tests/predict/test_retry.py.

Fixes #1356

…r()`

This fixes the issue that originally, `backtrack_handler()` clears
`dsp.settings.trace`, which is also used by optimizers such as
`BootstrapFewShot`.
@okhat
Copy link
Collaborator

okhat commented Aug 6, 2024

thank you @theta-lin ! cc @Shangyint is this OK? thoughts?

@theta-lin
Copy link
Contributor Author

Oops, I think I accidentally used a higher version of pytest locally so that I didn't fail the test. I found that just

pytest tests/teleprompt/test_mipro_optimizer.py

works fine, but

pytest tests/predict/test_retry.py tests/teleprompt/test_mipro_optimizer.py

fails. Something funky must be going on, possibly related to global states. I would investigate further.

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.

Bug: Assertion backtrack_handler() clears dsp.settings.trace, which deletes demo from e.g. BootstrapFewShot
2 participants