Skip to content

Commit e118f10

Browse files
authored
Update how-to-share-models-pipelines-across-workspaces-with-registries.md
1 parent 0637d58 commit e118f10

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

articles/machine-learning/how-to-share-models-pipelines-across-workspaces-with-registries.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ Next, you'll now copy the model from the workspace to the registry. Note now the
509509
510510
511511
```azurecli
512-
# copy model registered in workspace to registry
513-
az ml model create --registry-name <registry-name> --path azureml://subscriptions/<subscription-id-of-workspace>/resourceGroups/<resource-group-of-workspace>/workspaces/<workspace-name>/models/nyc-taxi-model/versions/1
512+
# share model registered in workspace to registry
513+
az ml model share --name nyc-taxi-model --version 1 --registry-name <registry-name> --share-with-name <new-name> --share-with-version <new-version>
514514
```
515515
516516
> [!TIP]
@@ -560,14 +560,8 @@ Next, you'll now copy the model from the workspace to the registry. Construct th
560560
561561
562562
```python
563-
# fetch the model from workspace
564-
model_in_workspace = ml_client_workspace.models.get(name="nyc-taxi-model", version=version)
565-
print(model_in_workspace )
566-
# change the format such that the registry understands the model (when you print the model_ready_to_copy object, notice the asset id
567-
model_ready_to_copy = ml_client_workspace.models._prepare_to_copy(model_in_workspace)
568-
print(model_ready_to_copy)
569-
# copy the model from registry to workspace
570-
ml_client_registry.models.create_or_update(model_ready_to_copy)
563+
# share the model from registry to workspace
564+
ml_client.models.share(name="nyc-taxi-model", version=1, registry_name=<registry_name>, share_with_name=<new-name>, share_with_version=<new-version>)
571565
```
572566
573567
> [!TIP]

0 commit comments

Comments
 (0)