You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/tutorials/deployment/index.md
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -146,9 +146,14 @@ Let's spin up the MLflow tracking server, where we will store our DSPy program.
146
146
```
147
147
148
148
Then we can define the DSPy program and log it to the MLflow server. "log" is an overloaded term in MLflow, basically it means
149
-
we store the program information along with environment requirements in the MLflow server. This is done via the `mlflow.dspy.log_model()` function which takes a custom `dspy.Module` object along with a model signature that defines the expected schema for model inputs and outputs.
149
+
we store the program information along with environment requirements in the MLflow server. This is done via the `mlflow.dspy.log_model()`
150
+
function, please see the code below:
150
151
151
-
See the code below:
152
+
> [!NOTE]
153
+
> As of MLflow 2.22.0, there is a caveat that you must wrap your DSPy program in a custom DSPy Module class when deploying with MLflow.
154
+
> This is because MLflow requires positional arguments while DSPy pre-built modules disallow positional arguments, e.g., `dspy.Predict`
155
+
> or `dspy.ChainOfThought`. To work around this, create a wrapper class that inherits from `dspy.Module` and implement your program's
156
+
> logic in the `forward()` method, as shown in the example below.
0 commit comments