forked from stanfordnlp/dspy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'stanfordnlp:main' into main
- Loading branch information
Showing
11 changed files
with
440 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .synthesizer import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from typing import Any, Optional | ||
|
||
from pydantic import BaseModel, model_validator | ||
|
||
|
||
class SynthesizerArguments(BaseModel): | ||
feedback_mode: Optional[str] = None | ||
num_example_for_feedback: Optional[int] = None | ||
|
||
input_lm_model: Optional[Any] = None | ||
output_lm_model: Optional[Any] = None | ||
output_teacher_module: Optional[Any] = None | ||
|
||
num_example_for_optim: Optional[int] = None | ||
|
||
@model_validator(mode='after') | ||
def validate_feedback_mode(self): | ||
if self.feedback_mode and self.feedback_mode not in ["human", "llm"]: | ||
raise ValueError("Feedback mode should be either 'human' or 'llm'.") | ||
|
||
if self.feedback_mode and not self.num_example_for_feedback: | ||
raise ValueError("Number of examples for feedback is required when feedback mode is provided.") | ||
|
||
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INPUT_GENERATION_TASK_WITH_EXAMPLES_SUFFIX = """\n\nI'll also be providing you some data I generated before hand, make sure the data you generate if consistent with task I provided but different from the data I provided in every way possible.""" | ||
|
||
INPUT_GENERATION_TASK_WITH_FEEDBACK_SUFFIX = "\n\nAdditionally, I'll be providing you with feedback on the data you generate, while generating the data make sure to take into account the feedback I provide and try to improve the data you generate based on the feedback I provide." |
Oops, something went wrong.