Skip to content

Commit d0b620d

Browse files
authored
Obsolete model reference type, that breaks the code for SDK v.2
Use of "from azure.ai.ml.constants import ModelType" and setting Model type with "type=ModelType.MLFLOW" makes the code execution fail, with error saying that MLFLOW is not supported type and advising that one of the supported ones is mlflow_model. Got this resolved only after changing constant set to "from azure.ai.ml.constants import AssetTypes" and setting Model type with "type=AssetTypes.MLFLOW_MODEL".
1 parent 31023f7 commit d0b620d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/machine-learning/how-to-train-model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,13 @@ The following examples demonstrate how to register a model in your AzureML works
299299
300300
```python
301301
from azure.ai.ml.entities import Model
302-
from azure.ai.ml.constants import ModelType
302+
from azure.ai.ml.constants import AssetTypes
303303
304304
run_model = Model(
305305
path="azureml://jobs/{}/outputs/artifacts/paths/model/".format(returned_job.name),
306306
name="run-model-example",
307307
description="Model created from run.",
308-
type=ModelType.MLFLOW
308+
type=AssetTypes.MLFLOW_MODEL
309309
)
310310
311311
ml_client.models.create_or_update(run_model)

0 commit comments

Comments
 (0)