module documentation
Undocumented
| Function | create |
Creates a new variant of a model. |
| Function | create |
Creates a new variant of a model. |
| Function | delete |
Deletes a model variant. |
| Function | delete |
Deletes a model variant. |
| Function | get |
Returns information about a model version. |
| Function | get |
Returns information about a model version. |
| Function | list |
List the model versions in the HubAI. |
| Function | list |
List the model versions in the HubAI. |
| Constant | VARIANT |
Undocumented |
| Constant | VARIANT |
Undocumented |
| Constant | VARIANT |
Undocumented |
| Variable | app |
Undocumented |
| Function | _print |
Undocumented |
| Function | _print |
Undocumented |
| Function | _variant |
Undocumented |
@telemetry_operation( OperationTelemetrySpec( operation_name=OperationName.VARIANT_CREATE, operation_group=TelemetryGroup.VARIANTS, success_event=VARIANT_CREATED_EVENT, target_resource=TargetResource.VARIANT, success_builder=build_variant_created_properties))
def create_variant(name: str, *, model_id: UUID | str, variant_version: str, description: str | None = None, repository_url: str | None = None, commit_hash: str | None = None, domain: str | None = None, tags: list[ str] | None = None) -> ModelVersionResponse:
¶
Creates a new variant of a model.
| Parameters | |
name:str | str. The name of the model variant. |
modelUUID | str | UUID | str. The ID of the model to create a variant for. |
variantstr | str. The version of the model variant. |
description:str | None | str | None. Full description of the model variant. |
repositorystr | None | str | None. URL of the related repository. |
commitstr | None | str | None. Commit hash. |
domain:str | None | str | None. Domain of the model variant. |
tags:list[ | list[str] | None. List of tags for the model variant. |
| Returns | |
ModelVersionResponse | The created model version resource. |
@app.command( name='create')
def create_variant_cli(name: str, *, model_id: UUID | str, variant_version: str, description: str | None = None, repository_url: str | None = None, commit_hash: str | None = None, domain: str | None = None, tags: list[ str] | None = None):
¶
Creates a new variant of a model.
@telemetry_operation( OperationTelemetrySpec( operation_name=OperationName.VARIANT_DELETE, operation_group=TelemetryGroup.VARIANTS, success_event=VARIANT_DELETED_EVENT, target_resource=TargetResource.VARIANT, identifier_param='identifier', success_builder=build_model_identifier_properties))
def delete_variant(identifier: UUID | str):
¶
Deletes a model variant.
| Parameters | |
identifier:UUID | str | UUID | str. The model variant ID or slug. |
@telemetry_operation( OperationTelemetrySpec( operation_name=OperationName.VARIANT_GET, operation_group=TelemetryGroup.VARIANTS, success_event=VARIANT_RETRIEVED_EVENT, target_resource=TargetResource.VARIANT, identifier_param='identifier', success_builder=build_model_identifier_properties))
def get_variant(identifier: UUID | str) -> ModelVersionResponse:
¶
Returns information about a model version.
| Parameters | |
identifier:UUID | str | UUID | str. The model version ID or slug. |
| Returns | |
ModelVersionResponse | The resolved model version resource. |
@telemetry_operation( OperationTelemetrySpec( operation_name=OperationName.VARIANTS_LIST, operation_group=TelemetryGroup.VARIANTS, success_event=VARIANTS_LISTED_EVENT, target_resource=TargetResource.VARIANT, success_builder=build_variants_listed_properties))
def list_variants(model_id: UUID | str | None = None, name: str | None = None, variant_slug: str | None = None, variant_version: str | None = None, is_public: bool | None = None, include_model_name: bool = False, limit: int = 50, sort: str = 'updated', order: Order = 'desc') -> list[ ModelVersionResponse]:
¶
List the model versions in the HubAI.
| Parameters | |
modelUUID | str | None | UUID | str | None. Filter the listed model versions by model ID. |
name:str | None | str | None. Filter the listed model versions by name. |
variantstr | None | str | None. Filter the listed model versions by variant slug. |
variantstr | None | str | None. Filter the listed model versions by version. |
isbool | None | bool | None. Filter the listed model versions by visibility. |
includebool | bool. Whether to include the model name in the response. By default, it is False and the ModelVersionResponse will have "model_name" field as None. If True, the ModelVersionResponse will have "model_name" field as the name of the model. |
limit:int | int. Limit the number of model versions to show. |
sort:str | str. Sort the model versions by this field. It should be the field name from the ModelVersionResponse. For example, "name", "id", "updated", etc. |
order:Order | Literal["asc", "desc"]. Order to sort the model versions by. It should be "asc" or "desc". |
| Returns | |
list[ | A list of matching model version resources. |
@app.command( name='ls')
def list_variants_cli(model_id: UUID | str | None = None, name: str | None = None, variant_slug: str | None = None, variant_version: str | None = None, is_public: bool | None = None, include_model_name: bool = False, limit: int = 50, sort: str = 'updated', order: Order = 'desc', field: Annotated[ list[ str] | None, Parameter( name=[ (--field), (-f)])] = None):
¶
List the model versions in the HubAI.
def _print_variant_list(variants:
list[ ModelVersionResponse], include_model_name: bool, field: list[ str] | None = None):
¶
Undocumented