Skip to content

Commit 18cffab

Browse files
committed
try to fix
1 parent f2787ef commit 18cffab

File tree

1 file changed

+49
-51
lines changed

1 file changed

+49
-51
lines changed

articles/machine-learning/how-to-use-mlflow-cli-runs.md

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.devlang: azurecli
1616

1717
# Track experiments and models with MLflow
1818

19-
*Tracking* is the process of saving relevant information about experiments. In this article, you learn how to use MLflow for tracking experiments and runs in Azure Machine Learning workspaces. The saved metadata varies by experiment, and can include:
19+
*Tracking* is the process of saving relevant information about experiments. In this article, you learn how to use MLflow for tracking experiments and runs in Azure Machine Learning workspaces. The saved tracking metadata varies by experiment, and can include:
2020

2121
- Code
2222
- Environment details such as OS version and Python packages
@@ -130,83 +130,81 @@ All Azure Machine Learning curated environments already have MLflow installed. H
130130

131131
:::code language="yaml" source="~/azureml-examples-main/sdk/python/using-mlflow/deploy/environment/conda.yaml" highlight="7-8" range="1-12":::
132132

133-
Reference the environment in your job.
134-
135133
### Configure your job name
136134

137-
Use the Azure Machine Learning jobs parameter `display_name` to configure the name of the job. Make sure not to use `mlflow.start_run(run_name="")` inside your training routine.
135+
Use the Azure Machine Learning jobs parameter `display_name` to configure the name of the run.
138136

139-
# [Azure CLI](#tab/cli)
137+
1. Use the `display_name` property to configure the job.
140138

141-
Create a YAML file with your job definition in a *job.yml* file outside the *src* directory.
139+
# [Azure CLI](#tab/cli)
142140

143-
:::code language="yaml" source="~/azureml-examples-main/cli/jobs/basics/hello-world-org.yml" highlight="7" range="1-9":::
141+
To submit the job, create a YAML file with your job definition in a *job.yml* file outside of the *src* directory.
144142

145-
# [Python SDK](#tab/python)
143+
:::code language="yaml" source="~/azureml-examples-main/cli/jobs/basics/hello-world-org.yml" highlight="7" range="1-9":::
146144

147-
Create the command job as follows:
145+
# [Python SDK](#tab/python)
148146

149-
```python
150-
from azure.ai.ml import command, Environment
151-
152-
command_job = command(
153-
code="src",
154-
command="echo "hello world",
155-
environment=Environment(image="library/python:latest"),
156-
compute="cpu-cluster",
157-
display_name="hello-world-example"
158-
)
159-
```
147+
```python
148+
from azure.ai.ml import command, Environment
160149

161-
### Submit the job
162-
163-
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work with the artifacts you create. Jobs that use MLflow and run on Azure Machine Learning automatically log any tracking information to the workspace. In this section, you connect to the workspace to do deployment tasks.
150+
command_job = command(
151+
code="src",
152+
command="echo "hello world",
153+
environment=Environment(image="library/python:latest"),
154+
compute="cpu-cluster",
155+
display_name="hello-world-example"
156+
)
157+
```
164158

165-
1. Connect to your Azure Machine Learning workspace.
159+
1. Make sure not to use `mlflow.start_run(run_name="")` inside your training routine.
166160

167-
# [Azure CLI](#tab/cli)
168-
169-
Open your terminal and enter the following code:
161+
### Submit the job
170162

171-
```azurecli
172-
az account set --subscription <subscription>
173-
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
174-
```
163+
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work with all the Azure Machine Learning artifacts you create.
175164

176-
# [Python SDK](#tab/python)
165+
1. Connect to the Azure Machine Learning workspace.
177166

167+
# [Azure CLI](#tab/cli)
178168

179-
180-
1. Import the required libraries:
169+
```azurecli
170+
az account set --subscription <subscription>
171+
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
172+
```
181173

182-
```python
183-
from azure.ai.ml import MLClient
184-
from azure.identity import DefaultAzureCredential
185-
```
186-
187-
1. Configure workspace details and get a handle to the workspace:
188-
189-
```python
190-
subscription_id = "<subscription>"
191-
resource_group = "<resource-group>"
192-
workspace = "<workspace>"
193-
194-
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
195-
```
174+
# [Python SDK](#tab/python)
175+
176+
Connect to the Azure Machine Learning workspace.
177+
178+
1. Import the required libraries:
179+
180+
```python
181+
from azure.ai.ml import MLClient
182+
from azure.identity import DefaultAzureCredential
183+
```
184+
185+
2. Configure workspace details and get a handle to the workspace:
186+
187+
```python
188+
subscription_id = "<subscription>"
189+
resource_group = "<resource-group>"
190+
workspace = "<workspace>"
191+
192+
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
193+
```
196194

197-
1. Submit the job
195+
1. Open your terminal and use the following code to submit the job. Jobs that use MLflow and run on Azure Machine Learning automatically log any tracking information to the workspace.
198196

199197
# [Azure CLI](#tab/cli)
200198

201-
Use the Azure Machine Learning CLI to [submit your job](how-to-train-model.md).
199+
Use the Azure Machine Learning CLI [to submit your job](how-to-train-model.md).
202200

203201
```azurecli
204202
az ml job create -f job.yml --web
205203
```
206204

207205
# [Python SDK](#tab/python)
208206

209-
Use the Python SDK to [submit your job](how-to-train-model.md).
207+
Use the Python SDK [to submit your job](how-to-train-model.md).
210208

211209
```python
212210
returned_job = ml_client.jobs.create_or_update(command_job)

0 commit comments

Comments
 (0)