DSPy: The framework for programming—not prompting—language models
Python
merged
klopsahlong5e6166f9dd1e
diff --cc dspy/teleprompt/signature_opt_bayesian.pyindex 48b007671,995378cf1..82d92fc9e--- a/dspy/teleprompt/signature_opt_bayesian.py+++ b/dspy/teleprompt/signature_opt_bayesian.py@@@ -41,5 -47,26 +42,5 @@@ class BayesianSignatureOptimizer(MIPRO)super().__init__(prompt_model, task_model, teacher_settings,n,metric,init_temperature,verbose,track_stats,view_data_batch_size)- def compile(self, student, *, devset, max_bootstrapped_demos, max_labeled_demos, eval_kwargs, seed=42, view_data=True, view_examples=True, requires_permission_to_run=True, trials_num=None, optuna_trials_num=None):- # Define ANSI escape codes for colors- YELLOW = '\033[93m'- BLUE = '\033[94m'- BOLD = '\033[1m'- ENDC = '\033[0m' # Resets the color to default-- # Check if both trials_num and optuna_trials_num are None- if trials_num is None and optuna_trials_num is None:- raise ValueError(f"{YELLOW}{BOLD}You must specify the number of trials using the 'trials_num' parameter.{ENDC}")-- # Check if the deprecated parameter is used- if optuna_trials_num is not None:- # Issue a deprecation warning- warnings.warn(- "`optuna_trials_num` is deprecated and will be removed in a future version. "- "Use `trials_num` instead.",- DeprecationWarning,- )- # Use trials_num as a fallback if trials_num is not provided- if trials_num is None:- trials_num = optuna_trials_num- return super().compile(student, trainset=devset, max_bootstrapped_demos=max_bootstrapped_demos, max_labeled_demos=max_labeled_demos, eval_kwargs=eval_kwargs, seed=seed, view_data=view_data, view_examples=view_examples, requires_permission_to_run=requires_permission_to_run, num_trials=trials_num)+ def compile(self, student, *, devset, max_bootstrapped_demos, max_labeled_demos, eval_kwargs, seed=42, optuna_trials_num, view_data=True, view_examples=True, requires_permission_to_run=True, num_trials=None):- return super().compile(student, trainset=devset, max_bootstrapped_demos=max_bootstrapped_demos, max_labeled_demos=max_labeled_demos, eval_kwargs=eval_kwargs, seed=seed, view_data=view_data, view_examples=view_examples, requires_permission_to_run=requires_permission_to_run, num_trials=optuna_trials_num)++ return super().compile(student, trainset=devset, max_bootstrapped_demos=max_bootstrapped_demos, max_labeled_demos=max_labeled_demos, eval_kwargs=eval_kwargs, seed=seed, view_data=view_data, view_examples=view_examples, requires_permission_to_run=requires_permission_to_run, num_trials=optuna_trials_num)