Skip to content

Commit

Permalink
support activate_assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shangyint committed Feb 8, 2024
1 parent 776d734 commit ca7aad8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dspy/primitives/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ def map_named_predictors(self, func):
for name, predictor in self.named_predictors():
set_attribute_by_name(self, name, func(predictor))
return self

def activate_assertions(self, handler=backtrack_handler, **handler_args):
"""
Activates assertions for the module.
The default handler is the backtrack_handler.
"""
assert_transform_module(self, handler, **handler_args)
return self

# def __deepcopy__(self, memo):
# # memo is a dict of id's to copies already made during the current call
Expand Down

0 comments on commit ca7aad8

Please sign in to comment.