dspy.load¶
dspy.load(path: str, allow_pickle: bool = False) -> Module
¶
Load saved DSPy model.
This method is used to load a saved DSPy model with save_program=True, i.e., the model is saved with cloudpickle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the saved model. |
required |
allow_pickle
|
bool
|
Whether to allow loading the model with pickle. This is dangerous and should only be used if you are sure you trust the source of the model. |
False
|
Returns:
| Type | Description |
|---|---|
Module
|
The loaded model, a |
Source code in dspy/utils/saving.py
:::