DSPy: The framework for programming—not prompting—language models
Python
chore: ruff fixes
KCaverly9de30764498f
diff --git a/dspy/evaluate/evaluate.py b/dspy/evaluate/evaluate.pyindex 86b271ee5..b7a8ae4f9 100644--- a/dspy/evaluate/evaluate.py+++ b/dspy/evaluate/evaluate.py@@ -1,9 +1,9 @@+import sysimport threadingimport typesimport pandas as pdimport tqdm-import sysfrom tqdm.contrib.logging import logging_redirect_tqdmimport dspydiff --git a/dspy/teleprompt/bootstrap.py b/dspy/teleprompt/bootstrap.pyindex 26d625d22..8bbecef8f 100644--- a/dspy/teleprompt/bootstrap.py+++ b/dspy/teleprompt/bootstrap.py@@ -125,7 +125,7 @@ class BootstrapFewShot(Teleprompter):bootstrapped[example_idx] = Truedspy.logger.info(- f"Bootstrapped {len(bootstrapped)} full traces after {example_idx + 1} examples in round {round_idx}."+ f"Bootstrapped {len(bootstrapped)} full traces after {example_idx + 1} examples in round {round_idx}.",)# Unbootstrapped training examples@@ -190,7 +190,7 @@ class BootstrapFewShot(Teleprompter):try:predictor_name = self.predictor2name[id(predictor)]- except KeyError as e:+ except KeyError:continue # FIXME: !# # TODO: Look closer into this. It's a bit tricky to reproduce.diff --git a/dspy/teleprompt/random_search.py b/dspy/teleprompt/random_search.pyindex bbeaa90af..2b9c4e592 100644--- a/dspy/teleprompt/random_search.py+++ b/dspy/teleprompt/random_search.py@@ -56,7 +56,7 @@ class BootstrapFewShotWithRandomSearch(Teleprompter):self.max_labeled_demos = max_labeled_demosdspy.logger.info(- "Going to sample between", self.min_num_samples, "and", self.max_num_samples, "traces per predictor."+ "Going to sample between", self.min_num_samples, "and", self.max_num_samples, "traces per predictor.",)dspy.logger.info("Will attempt to train", self.num_candidate_sets, "candidate sets.")