Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

add assert transform field

Shangyint62c601f06ba2
diff --git a/dspy/primitives/assertions.py b/dspy/primitives/assertions.py
index fc134cbeb..dcb2a4782 100644
--- a/dspy/primitives/assertions.py
+++ b/dspy/primitives/assertions.py
@@ -374,4 +374,6 @@ def assert_transform_module(
module
)
+ setattr(module, "_assert_transformed", True)
+
return module
diff --git a/dspy/teleprompt/bootstrap.py b/dspy/teleprompt/bootstrap.py
index ef1af8ee2..9a8db31ce 100644
--- a/dspy/teleprompt/bootstrap.py
+++ b/dspy/teleprompt/bootstrap.py
@@ -63,9 +63,6 @@ class BootstrapFewShot(Teleprompter):
assert self.student._compiled is False, "Student must be uncompiled."
- self.student = assert_transform_module(self.student, noop_handler)
- self.teacher = assert_transform_module(self.teacher, noop_handler)
-
if self.max_labeled_demos and self.teacher._compiled is False:
teleprompter = LabeledFewShot(k=self.max_labeled_demos)
self.teacher = teleprompter.compile(self.teacher.reset_copy(), trainset=self.trainset)