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
Define a MLFlow model, using a custom params parameter. Example from the MLFlow documentation:
class ModelWrapper(PythonModel):
def __init__(self):
self.model = None
def load_context(self, context):
from joblib import load
self.model = load(context.artifacts["model_path"])
def predict(self, context, model_input, params=None):
params = params or {"predict_method": "predict"}
predict_method = params.get("predict_method")
if predict_method == "predict":
return self.model.predict(model_input)
elif predict_method == "predict_proba":
return self.model.predict_proba(model_input)
elif predict_method == "predict_log_proba":
return self.model.predict_log_proba(model_input)
else:
raise ValueError(f"The prediction method '{predict_method}' is not supported.")
Log that model into MLFlow, and try to serve it using MLServer. Create an inference request using a specific parameter. The parameter value is not taken into account.
Proposed fix
Currently, the predict function in the MLFlow runtime does not pass the params parameter in the prediction. We can add it, like it was done for the custom invocation endpoint.
PR
The text was updated successfully, but these errors were encountered:
idlefella
added a commit
to idlefella/MLServer
that referenced
this issue
Oct 8, 2024
How to reproduce
Define a MLFlow model, using a custom
params
parameter. Example from the MLFlow documentation:Log that model into MLFlow, and try to serve it using MLServer. Create an inference request using a specific parameter. The parameter value is not taken into account.
Proposed fix
Currently, the predict function in the MLFlow runtime does not pass the
params
parameter in the prediction. We can add it, like it was done for the custom invocation endpoint.PR
The text was updated successfully, but these errors were encountered: