DSPy: The framework for programming—not prompting—language models
Python
add fix for max_bootstraps
J S92a5addc1daf
diff --git a/dspy/teleprompt/bootstrap.py b/dspy/teleprompt/bootstrap.pyindex fe1e9ca9e..b885bea0f 100644--- a/dspy/teleprompt/bootstrap.py+++ b/dspy/teleprompt/bootstrap.py@@ -96,15 +96,15 @@ class BootstrapFewShot(Teleprompter):self.name2predictor = name2predictorself.predictor2name = predictor2name- def _bootstrap(self, *, max_bootsraps=None):- max_bootsraps = max_bootsraps or self.max_bootstrapped_demos+ def _bootstrap(self, *, max_bootstraps=None):+ max_bootstraps = max_bootstraps or self.max_bootstrapped_demosbootstrapped = {}self.name2traces = {name: [] for name in self.name2predictor}for round_idx in range(self.max_rounds):for example_idx, example in enumerate(tqdm.tqdm(self.trainset)):- if len(bootstrapped) >= max_bootsraps:+ if len(bootstrapped) >= max_bootstraps:breakif example_idx not in bootstrapped: