DSPy: The framework for programming—not prompting—language models
Python
Clean up dead code
Shangyint94eedeafc9b2
diff --git a/dspy/primitives/assertions.py b/dspy/primitives/assertions.pyindex 5a7db0cff..fc134cbeb 100644--- a/dspy/primitives/assertions.py+++ b/dspy/primitives/assertions.py@@ -250,7 +250,6 @@ def suggest_backtrack_handler(func, max_backtracks=2):with updated signature if a suggestion fails. updated signature adds a newinput field to the signature, which is the feedback."""- from ..predict.retry import Retrydef wrapper(*args, **kwargs):error_msg, result = None, None@@ -332,15 +331,6 @@ def suggest_backtrack_handler(func, max_backtracks=2):f"UNREACHABLE: No trace available, this should not happen. Is this run time?")- # cleanup: after all tries revert any leftover predictors to their originals- # if dspy.settings.predictors_to_original_forward:- # for (- # predictor,- # original_forward,- # ) in dspy.settings.predictors_to_original_forward.items():- # _revert_predictor_signature(predictor, "feedback")- # setattr(predictor, "forward", original_forward.__get__(predictor))-return resultreturn wrapper