Skip to content

Add ability to return a predictor instead of modifying in place. #1738

@isaacbmiller

Description

@isaacbmiller

Currently, to load a predictor after optimization, you need to do it in two lines:

predictor = dspy.Predict("question -> answer")
predictor.load(saved_path)

Desired behavior

predictor = dspy.Predict("question -> answer").load(saved_path, return_self=True)

This fix is as adding a bool to the load method of BaseModule to return self.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions