BetaModelsOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
models attribute.
Constructor
BetaModelsOperations(*args, **kwargs)
Methods
| create |
Register a local model by running the full upload-first sequence. This wraps the three mandatory steps of the model-registration spec into a single call:
|
| delete |
Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. |
| get |
Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does not exist. |
| get_credentials |
Get credentials for a model version asset. |
| list |
List the latest version of each ModelVersion. |
| list_versions |
List all versions of the given ModelVersion. |
| pending_create_version |
Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header for polling. |
| pending_upload |
Start or retrieve a pending upload for a model version. |
| update |
Update an existing ModelVersion with the given version id. |
create
Register a local model by running the full upload-first sequence.
This wraps the three mandatory steps of the model-registration spec into a single call:
pending_upload — provision a project-managed blob container and obtain a SAS URI.
azcopy copy— upload the local weight files directly to the SAS container.pending_create_version — finalize registration with the
ModelVersionbody (blob_uri,weight_type,base_model,description,tags).
create(*, name: str, version: str, source: str | 'os.PathLike[str]', weight_type: str | None = None, base_model: str | None = None, description: str | None = None, tags: 'dict[str, str]' | None = None, azcopy_path: str | None = None, wait_for_commit: Literal[True] = True, polling_timeout: float = 300.0, polling_interval: float = 2.0, **kwargs: Any) -> ModelVersion
Keyword-Only Parameters
| Name | Description |
|---|---|
|
name
|
Name of the model to register. Required. |
|
version
|
Version identifier for the model. Required. |
|
source
|
Local file or directory containing the model weights. If a directory, its contents are uploaded recursively to the SAS container root. Required. |
|
weight_type
|
Optional weight type (e.g. Default value: None
|
|
base_model
|
Optional base model asset ID. Default value: None
|
|
description
|
Optional asset description. Default value: None
|
|
tags
|
Optional asset tags. Default value: None
|
|
azcopy_path
|
Optional explicit path to the azcopy executable.
Defaults to Default value: None
|
|
wait_for_commit
|
When True (default) poll get until
the committed Default value: True
|
|
polling_timeout
|
Total seconds to poll for commit completion. Default value: 300.0
|
|
polling_interval
|
Seconds between poll attempts. Default value: 2.0
|
Returns
| Type | Description |
|---|---|
|
The committed ModelVersion
when |
Exceptions
| Type | Description |
|---|---|
|
If |
|
|
If |
delete
Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist.
delete(name: str, version: str, **kwargs: Any) -> None
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The version of the ModelVersion to delete. Required. |
Returns
| Type | Description |
|---|---|
|
None |
Exceptions
| Type | Description |
|---|---|
get
Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does not exist.
get(name: str, version: str, **kwargs: Any) -> ModelVersion
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The specific version id of the ModelVersion to retrieve. Required. |
Returns
| Type | Description |
|---|---|
|
ModelVersion. The ModelVersion is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
get_credentials
Get credentials for a model version asset.
get_credentials(name: str, version: str, credential_request: ModelCredentialRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> DatasetCredential
Parameters
| Name | Description |
|---|---|
|
name
Required
|
Name of the model. Required. |
|
version
Required
|
Version of the model. Required. |
|
credential_request
Required
|
Is one of the following types: ModelCredentialRequest, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
DatasetCredential. The DatasetCredential is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
list
List the latest version of each ModelVersion.
list(**kwargs: Any) -> ItemPaged[ModelVersion]
Returns
| Type | Description |
|---|---|
|
An iterator like instance of ModelVersion |
Exceptions
| Type | Description |
|---|---|
list_versions
List all versions of the given ModelVersion.
list_versions(name: str, **kwargs: Any) -> ItemPaged[ModelVersion]
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
Returns
| Type | Description |
|---|---|
|
An iterator like instance of ModelVersion |
Exceptions
| Type | Description |
|---|---|
pending_create_version
Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header for polling.
pending_create_version(name: str, version: str, model_version: ModelVersion | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> CreateAsyncResponse
Parameters
| Name | Description |
|---|---|
|
name
Required
|
Name of the model. Required. |
|
version
Required
|
Version of the model. Required. |
|
model_version
Required
|
Model version to create. Is one of the following types: ModelVersion, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
CreateAsyncResponse. The CreateAsyncResponse is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
pending_upload
Start or retrieve a pending upload for a model version.
pending_upload(name: str, version: str, pending_upload_request: ModelPendingUploadRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> ModelPendingUploadResponse
Parameters
| Name | Description |
|---|---|
|
name
Required
|
Name of the model. Required. |
|
version
Required
|
Version of the model. Required. |
|
pending_upload_request
Required
|
Is one of the following types: ModelPendingUploadRequest, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
ModelPendingUploadResponse. The ModelPendingUploadResponse is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|
update
Update an existing ModelVersion with the given version id.
update(name: str, version: str, model_version_update: UpdateModelVersionRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) -> ModelVersion
Parameters
| Name | Description |
|---|---|
|
name
Required
|
The name of the resource. Required. |
|
version
Required
|
The specific version id of the UpdateModelVersionRequest to create or update. Required. |
|
model_version_update
Required
|
The UpdateModelVersionRequest to create or update. Is one of the following types: UpdateModelVersionRequest, JSON, IO[bytes] Required. |
Returns
| Type | Description |
|---|---|
|
ModelVersion. The ModelVersion is compatible with MutableMapping |
Exceptions
| Type | Description |
|---|---|