Share via


CLI (v2) 模型 YAML 結構描述

適用於:Azure CLI ml 延伸模組第 2 版 (目前)

您可以在 https://azuremlschemas.azureedge.net/latest/model.schema.json 中找到來源 JSON 結構描述。

注意

此文件中詳述的 YAML 語法是以最新版 ML CLI v2 延伸模組的 JSON 結構描述為基礎。 此語法只保證能與最新版的 ML CLI v2 延伸模組搭配使用。 您可以在 https://azuremlschemasprod.azureedge.net/ 找到舊版延伸模組的結構描述。

YAML 語法

索引鍵 類型 描述 允許的值
$schema 字串 YAML 結構描述。
name 字串 必要。 模型的名稱。
version int 模型的版本。 如果省略,Azure Machine Learning 會自動產生版本。
description 字串 模型的描述。
tags object 模型標記的字典。
path 字串 模型檔案的本機路徑,或模型檔案的雲端路徑 URI。 這可指向檔案或目錄。
type 字串 模型的儲存體格式類型。 適用於無程式碼部署案例。 custom_model, mlflow_model, triton_model
flavors object 模型的類別。 每個模型儲存格式類型可能會有一或多個支援的類別。 適用於無程式碼部署案例。

備註

您可以使用 az ml model 命令來管理 Azure Machine Learning 模型。

範例

範例 GitHub 存放庫中有範例可用。 以下顯示其中幾個。

YAML:本機檔案

$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: local-file-example
path: mlflow-model/model.pkl
description: Model created from local file.

YAML:MLflow 格式的本機資料夾

$schema: https://azuremlschemas.azureedge.net/latest/model.schema.json
name: local-mlflow-example
path: mlflow-model
type: mlflow_model
description: Model created from local MLflow model directory.