Skip to content

Commit e9c9ab0

Browse files
authored
Merge pull request #213457 from sdgilley/sdg-main-updates
remove v1 code from articles
2 parents 870515a + bf351f9 commit e9c9ab0

File tree

2 files changed

+1
-74
lines changed

2 files changed

+1
-74
lines changed

articles/machine-learning/concept-mlflow-models.md

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Any file generated (and captured) from an experiment's run or job is an artifact
2626

2727
You may have been logging artifacts already:
2828

29-
# [Using MLflow SDK](#tab/mlflow)
30-
3129
```python
3230
filename = 'model.pkl'
3331
with open(filename, 'wb') as f:
@@ -36,32 +34,6 @@ with open(filename, 'wb') as f:
3634
mlflow.log_artifact(filename)
3735
```
3836

39-
# [Using Azure ML SDK v1](#tab/sdkv1)
40-
41-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
42-
43-
```python
44-
filename = 'model.pkl'
45-
with open(filename, 'wb') as f:
46-
pickle.dump(model, f)
47-
48-
mlflow.log_file(filename)
49-
```
50-
51-
# [Using the outputs folder](#tab/outputs)
52-
53-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
54-
55-
```python
56-
os.mkdirs("outputs", exists_ok=True)
57-
58-
filename = 'outputs/model.pkl'
59-
with open(filename, 'wb') as f:
60-
pickle.dump(model, f)
61-
```
62-
63-
---
64-
6537
### Models
6638

6739
A model in MLflow is also an artifact. However, we make stronger assumptions about this type of artifacts. Such assumptions provide a clear contract between the saved files and what they mean. When you log your models as artifacts (simple files), you need to know what the model builder meant for each of them in order to know how to load the model for inference. On the contrary, MLflow models can be loaded using the contract specified in the [The MLModel format](concept-mlflow-models.md#the-mlmodel-format).
@@ -73,33 +45,13 @@ In Azure Machine Learning, logging models has the following advantages:
7345
> * Models can be used as pipelines inputs directly.
7446
> * You can use the [Responsible AI dashbord (preview)](how-to-responsible-ai-dashboard.md).
7547
76-
Models can get logged by:
77-
78-
# [Using MLflow SDK](#tab/mlflow)
48+
Models can get logged by using MLflow SDK:
7949

8050
```python
8151
import mlflow
8252
mlflow..sklearn.log_model(sklearn_estimator, "classifier")
8353
```
8454

85-
# [Using Azure ML SDK v1](#tab/sdkv1)
86-
87-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
88-
89-
> [!IMPORTANT]
90-
> Azure ML SDK v1 doesn't have the *model* concept.
91-
92-
# [Using the outputs folder](#tab/outputs)
93-
94-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
95-
96-
```python
97-
os.mkdirs("outputs/classifier", exists_ok=True)
98-
99-
mlflow.sklearn.save_model(sklearn_estimator, "outputs/classifier")
100-
```
101-
102-
---
10355

10456
## The MLmodel format
10557

articles/machine-learning/how-to-attach-kubernetes-to-workspace.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,7 @@ Set the `--type` argument to `Kubernetes`. Use the `identity_type` argument to e
6161
> `--user-assigned-identities` is only required for `UserAssigned` managed identities. Although you can provide a list of comma-separated user managed identities, only the first one is used when you attach your cluster.
6262
>
6363
> Compute attach won't create the Kubernetes namespace automatically or validate whether the kubernetes namespace existed. You need to verify that the specified namespace exists in your cluster, otherwise, any AzureML workloads submitted to this compute will fail.
64-
### [Python SDK](#tab/python)
6564
66-
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
67-
68-
```python
69-
from azureml.core.compute import KubernetesCompute, ComputeTarget
70-
71-
# Specify a name for your Kubernetes compute
72-
compute_target_name = "<kubernetes compute target name>"
73-
74-
# resource ID of the Arc-enabled Kubernetes cluster
75-
cluster_resource_id = "/subscriptions/<sub ID>/resourceGroups/<RG>/providers/Microsoft.Kubernetes/connectedClusters/<cluster name>"
76-
77-
user_assigned_identity_resouce_id = ['subscriptions/<sub ID>/resourceGroups/<RG>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity name>']
78-
79-
# Specify Kubernetes namespace to run AzureML workloads
80-
ns = "default"
81-
82-
try:
83-
compute_target = ComputeTarget(workspace=ws, name=compute_target_name)
84-
print('Found existing cluster, use it.')
85-
except ComputeTargetException:
86-
attach_configuration = KubernetesCompute.attach_configuration(resource_id = cluster_resource_id, namespace = ns, identity_type ='UserAssigned',identity_ids = user_assigned_identity_resouce_id)
87-
compute_target = ComputeTarget.attach(ws, compute_target_name, attach_configuration)
88-
compute_target.wait_for_completion(show_output=True)
89-
```
9065
### [Studio](#tab/studio)
9166

9267
Attaching a Kubernetes cluster makes it available to your workspace for training or inferencing.

0 commit comments

Comments
 (0)