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

Introduce dspy.Template #552

Merged

Conversation

KCaverly
Copy link
Collaborator

@KCaverly KCaverly commented Mar 4, 2024

The original implementation of TemplateBackend relied upon the signature_to_template function. This would take in a dspy.Signature and return a dsp.Template. However, we would pass dspy.Example into the dsp.Template and the extract function would return dsp.Example a different type. Leaving us with two different types of Example within a single prediction. To combat this, a new Template primitive was introduced into dspy to mirror and replace the original dsp.Template.

I do not expect this current PR to achieve feature parity with the original class, but initial tests have been introduced to mock and mirror the current prompt structure used in dsp.

Let me know what you think @CyrusOfEden, the last piece I believe to start using the TemplateBackend is to fully explore the do_generate function dealing with incomplete or inaccurate completions.

@CyrusNuevoDia
Copy link
Collaborator

YES man this is 🔥

@CyrusNuevoDia CyrusNuevoDia merged commit 3f387f0 into stanfordnlp:backend-refactor Mar 5, 2024
3 checks passed
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.

2 participants