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

Feature request: Handcraft and freeze parts of a prompt, optimize other parts #905

Open
AriMKatz opened this issue Apr 25, 2024 · 1 comment

Comments

@AriMKatz
Copy link

I don't believe this is possible. but unsure with the new backend refactor.

I'd like to be able to handcraft and "freeze" a prompt template and have DSPY fill in few shot examples, template variables and arbitrary things like that. These sections can have some initial value or just be blank.

Maybe this goes against the philosophy of Dspy and is a won't fix? I got some upvotes in discord when I posted this

@drawal1
Copy link
Contributor

drawal1 commented Apr 25, 2024

This is possible right now with one of the fixes in PR #843

Below is an example of pseudocode for doing this:

def my_optimize_fn:
# load previously optimized program
# re-optimize using COPRO optimizer
# re-optimize using BootstrapRandomFewShot
# save optimized program

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

No branches or pull requests

2 participants