Skip to content

armgit / dspy

Public Imported from GitHub
0

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.py
index 86b271ee5..b7a8ae4f9 100644
--- a/dspy/evaluate/evaluate.py
+++ b/dspy/evaluate/evaluate.py
@@ -1,9 +1,9 @@
+import sys
import threading
import types
import pandas as pd
import tqdm
-import sys
from tqdm.contrib.logging import logging_redirect_tqdm
import dspy
diff --git a/dspy/teleprompt/bootstrap.py b/dspy/teleprompt/bootstrap.py
index 26d625d22..8bbecef8f 100644
--- a/dspy/teleprompt/bootstrap.py
+++ b/dspy/teleprompt/bootstrap.py
@@ -125,7 +125,7 @@ class BootstrapFewShot(Teleprompter):
bootstrapped[example_idx] = True
dspy.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.py
index 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_demos
dspy.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.")