@@ -285,10 +285,10 @@ def get(self, name: str, version: Optional[str] = None, label: Optional[str] = N
285
285
286
286
:param name: Name of the model.
287
287
:type name: str
288
- :param version: Version of the model.
289
- :type version: str
290
- :param label: Label of the model. (mutually exclusive with version)
291
- :type label: str
288
+ :keyword version: Version of the model.
289
+ :paramtype version: str
290
+ :keyword label: Label of the model. (mutually exclusive with version)
291
+ :paramtype label: str
292
292
:raises ~azure.ai.ml.exceptions.ValidationException: Raised if Model cannot be successfully validated.
293
293
Details will be provided in the error message.
294
294
:return: Model asset object.
@@ -329,9 +329,9 @@ def download(self, name: str, version: str, download_path: Union[PathLike, str]
329
329
:type name: str
330
330
:param version: Version of the model.
331
331
:type version: str
332
- :param download_path: Local path as download destination, defaults to current working directory of the current
332
+ :keyword download_path: Local path as download destination, defaults to current working directory of the current
333
333
user. Contents will be overwritten.
334
- :type download_path: Union[PathLike, str]
334
+ :paramtype download_path: Union[PathLike, str]
335
335
:raises ResourceNotFoundError: if can't find a model matching provided name.
336
336
"""
337
337
@@ -403,10 +403,19 @@ def archive(
403
403
404
404
:param name: Name of model asset.
405
405
:type name: str
406
- :param version: Version of model asset.
407
- :type version: str
408
- :param label: Label of the model asset. (mutually exclusive with version)
409
- :type label: str
406
+ :keyword version: Version of model asset.
407
+ :paramtype version: str
408
+ :keyword label: Label of the model asset. (mutually exclusive with version)
409
+ :paramtype label: str
410
+
411
+ .. admonition:: Example:
412
+
413
+ .. literalinclude:: ../samples/ml_samples_misc.py
414
+ :start-after: [START model_operations_archive]
415
+ :end-before: [END model_operations_archive]
416
+ :language: python
417
+ :dedent: 8
418
+ :caption: Archive a model example.
410
419
"""
411
420
_archive_or_restore (
412
421
asset_operations = self ,
@@ -430,10 +439,19 @@ def restore(
430
439
431
440
:param name: Name of model asset.
432
441
:type name: str
433
- :param version: Version of model asset.
434
- :type version: str
435
- :param label: Label of the model asset. (mutually exclusive with version)
436
- :type label: str
442
+ :keyword version: Version of model asset.
443
+ :paramtype version: str
444
+ :keyword label: Label of the model asset. (mutually exclusive with version)
445
+ :paramtype label: str
446
+
447
+ .. admonition:: Example:
448
+
449
+ .. literalinclude:: ../samples/ml_samples_misc.py
450
+ :start-after: [START model_operations_restore]
451
+ :end-before: [END model_operations_restore]
452
+ :language: python
453
+ :dedent: 8
454
+ :caption: Restore a model example.
437
455
"""
438
456
_archive_or_restore (
439
457
asset_operations = self ,
@@ -455,13 +473,13 @@ def list(
455
473
) -> Iterable [Model ]:
456
474
"""List all model assets in workspace.
457
475
458
- :param name: Name of the model.
459
- :type name: Optional[str]
460
- :param stage: The Model stage
461
- :type stage: Optional[str]
462
- :keyword list_view_type: View type for including/excluding (for example) archived models. Defaults to
463
- :attr:`ListViewType.ACTIVE_ONLY`.
464
- :type list_view_type: ListViewType
476
+ :keyword name: Name of the model.
477
+ :paramtype name: Optional[str]
478
+ :keyword stage: The Model stage
479
+ :paramtype stage: Optional[str]
480
+ :keyword list_view_type: View type for including/excluding (for example) archived models.
481
+ Defaults to :attr:`ListViewType.ACTIVE_ONLY`.
482
+ :paramtype list_view_type: ListViewType
465
483
:return: An iterator like instance of Model objects
466
484
:rtype: ~azure.core.paging.ItemPaged[~azure.ai.ml.entities.Model]
467
485
"""
0 commit comments