Skip to content

Commit 4c2d510

Browse files
authored
Update how-to-manage-models-mlflow.md
1 parent b87994b commit 4c2d510

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

articles/machine-learning/how-to-manage-models-mlflow.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ Azure Machine Learning supports MLflow for model management. This represents a c
2020

2121
[!INCLUDE [mlflow-prereqs](../../includes/machine-learning-mlflow-prereqs.md)]
2222

23+
* Some operations may be executed directly using the MLflow fluent API (`mlflow.<method>`). However, others may require to create an MLflow client, which allows to communicate with Azure Machine Learning in the MLflow protocol. You can create an `MlflowClient` object as follows. This tutorial will use the object `client` to refer to such MLflow client.
24+
25+
```python
26+
using mlflow
27+
28+
client = mlflow.tracking.MlflowClient()
29+
```
30+
2331
## Registering new models in the registry
2432

2533
### Creating models from an existing run
@@ -33,6 +41,9 @@ mlflow.register_model(f"runs:/{run_id}/{artifact_path}", model_name)
3341
> [!NOTE]
3442
> Models can only be registered to the registry in the same workspace where the run was tracked. Cross-workspace operations are not supported by the moment in Azure Machine Learning.
3543
44+
> [!TIP]
45+
> We recommend to register models from runs or using the method `mlflow.<flavor>.log_model` from inside the run as it keeps lineage from the job that generated the asset.
46+
3647
### Creating models from assets
3748

3849
If you have a folder with an MLModel MLflow model, then you can register it directly. There's no need for the model to be always in the context of a run. To do that you can use the URI schema `file://path/to/model` to register MLflow models stored in the local file system. Let's create a simple model using `Scikit-Learn` and save it in MLflow format in the local storage:
@@ -65,15 +76,7 @@ mlflow.register_model(f"file://{model_local_path}", "local-model-test")
6576

6677
### Querying all the models in the registry
6778

68-
You can query all the registered models in the registry using the MLflow client with the method `list_registered_models`. The MLflow client is required to do all these operations.
69-
70-
```python
71-
using mlflow
72-
73-
client = mlflow.tracking.MlflowClient()
74-
```
75-
76-
The following sample prints all the model's names:
79+
You can query all the registered models in the registry using the MLflow client. The following sample prints all the model's names:
7780

7881
```python
7982
for model in client.search_registered_models():

0 commit comments

Comments
 (0)