You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从MLflow模型注册表加载最新版本的模型?

MLflow加载最新版本模型的方法

完全可以直接加载最新版本的模型,不需要提前查询最新版本号再传参,MLflow原生支持该能力。

你只需要把原有model_uri中版本号的位置替换为latest标识符即可,示例代码如下:

import mlflow

model = mlflow.pyfunc.load_model(
    model_uri=f"models:/c3760a15e6ac48f88ad7e5af940047d4/latest"
)

额外补充:如果你的模型在MLflow Registry中配置了阶段别名(比如Staging、Production),也可以直接用别名替换版本号位置,就能拉取对应阶段的最新可用版本,示例如下:

# 加载Production阶段的最新版本模型
model = mlflow.pyfunc.load_model(
    model_uri=f"models:/c3760a15e6ac48f88ad7e5af940047d4/Production"
)

内容的提问来源于stack exchange,提问作者Vincent Claes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 12:27:07