DSPy: The framework for programming—not prompting—language models
Python
revert patch safely (#8696)
Chen Qianc58c733bd8e0
diff --git a/dspy/teleprompt/bootstrap_trace.py b/dspy/teleprompt/bootstrap_trace.pyindex d3c81db4a..9f1eff5db 100644--- a/dspy/teleprompt/bootstrap_trace.py+++ b/dspy/teleprompt/bootstrap_trace.py@@ -107,7 +107,10 @@ def bootstrap_trace_data(program.forward = MethodType(patched_forward, program)- results = evaluator(program, metric=wrapped_metric).results+ try:+ results = evaluator(program, metric=wrapped_metric).results+ finally:+ program.forward = original_forwarddata = []for example_ind, (example, prediction, score) in enumerate(results):