我可以使用 MLflow 通过同一端口提供多个模型吗?

问题描述 投票:0回答:1

我正在阅读有关使用 MLflow 时开箱即用的部署工具的内容。

看来你可以通过执行类似的操作来从注册表中提供模型

mlflow models serve -m runs:/<run_id>/model <some server>:<some port>
.

然后,您发送一些数据并通过执行操作返回预测

curl http:/<some server>:<some port>/invocations -H 'Content-Type: application/json' -d '{
    "inputs": {<some data>}
}'. 

这很棒,但这是否意味着您只能在一个端口上提供一种模型?这是最佳实践还是技术限制?

port endpoint mlflow mlops
1个回答
0
投票

您可以使用 MLflow 提供任何模型,如果您想对多个模型使用单个端点,您可以使用 pyfunc 模块将所有模型打包到单个模型中并部署该模型。 这里有一个例子。

在该示例中,有两个模型,并且围绕这些模型创建包装器,然后,在推理时间期间,我们选择哪个模型使用输入参数进行预测。

在这里您还可以找到针对 Azure Databricks 发布的示例

© www.soinside.com 2019 - 2024. All rights reserved.