Skip to content

[Bug] Bad encoding for saving optimizations #8271

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

Open
ItzAmirreza opened this issue May 24, 2025 · 0 comments
Open

[Bug] Bad encoding for saving optimizations #8271

ItzAmirreza opened this issue May 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ItzAmirreza
Copy link
Contributor

What happened?

Image

I use markdowns and other types of text. That's not the problem until after the optimization, dspy decides to save with non utf-8 encoding. I'm not sure but this might cause different behaviour for loading and reusing that model later on.

Steps to reproduce

from dspy.teleprompt import BootstrapFewShot
optimizer = BootstrapFewShot(metric=metric, max_labeled_demos=4, max_bootstrapped_demos=4)
optimized_program = optimizer.compile(program, trainset=examples)

optimized_program.save("optimized_program.json")

DSPy version

2.6.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant