module documentation
Undocumented
| Function | full |
Resolve a full HubAI slug to a resource ID using the slug API. |
| Function | get |
Sets up the configuration. |
| Function | get |
Build an output directory path for a conversion result. |
| Function | get |
Resolve a UUID, HubAI ID, or slug into a resource ID. |
| Function | get |
Fetch raw HubAI resource data for a resolved identifier. |
| Function | get |
Build export options for a target from a parsed config. |
| Function | get |
Derive a variant name, appending input resolution when known. |
| Function | get |
Return the next patch version for a model's variants. |
| Function | init |
Create the SDK working directories if they do not exist. |
| Function | is |
Return whether an identifier looks like a HubAI resource ID. |
| Function | is |
Return whether a string is a valid UUID. |
| Function | print |
Render a list of HubAI resources as a rich table. |
| Function | print |
Render a single HubAI resource in CLI-friendly rich output. |
| Function | raise |
Translate a requests HTTPError into an SDK-specific exception. |
| Function | resolve |
Resolve an identifier and translate lookup failures to SDK errors. |
| Function | run |
Run a CLI action and convert SDK exceptions into clean exits. |
| Function | slug |
Resolve a simple slug to a resource ID by querying HubAI. |
| Function | wait |
Poll a HubAI job until it completes or fails. |
| Type Variable | T |
Undocumented |
| Type Alias | |
Undocumented |
| Function | _format |
Format validation-style error items into a single message string. |
| Function | _get |
Extract a readable error message from a requests HTTPError. |
def full_slug_to_id(slug:
str, endpoint: Literal[ 'models', 'modelVersions', 'modelInstances']) -> str:
¶
Resolve a full HubAI slug to a resource ID using the slug API.
def get_configs(path:
str | None, opts: list[ str] | dict[ str, Any] | None = None) -> tuple[ Config, NNArchiveConfig | None, str | None]:
¶
Sets up the configuration.
| Parameters | |
path:str | None | Path to the configuration file or NN Archive. |
opts:list[ | Optional CLI overrides for the config file. |
| Returns | |
tuple[ | Tuple of the parsed modelconverter Config, optional
NNArchiveConfig, and the main stage key. |
def get_resource_id(identifier:
str, endpoint: Literal[ 'models', 'modelVersions', 'modelInstances']) -> str:
¶
Resolve a UUID, HubAI ID, or slug into a resource ID.
| Parameters | |
identifier:str | User-supplied UUID, HubAI ID, or slug. |
endpoint:Literal[ | Resource endpoint to resolve against. |
| Returns | |
str | The resolved HubAI resource ID. |
| Raises | |
ValueError | If the identifier cannot be resolved. |
def get_target_specific_options(target:
Target, cfg: SingleStageConfig, tool_version: str | None = None) -> dict[ str, Any]:
¶
Build export options for a target from a parsed config.
def print_hub_ls(data:
list[ dict[ str, Any]], keys: list[ str], rename: dict[ str, str] | None = None):
¶
Render a list of HubAI resources as a rich table.
def print_hub_resource_info(model:
dict[ str, Any], keys: list[ str], json: bool, rename: dict[ str, str] | None = None, **kwargs):
¶
Render a single HubAI resource in CLI-friendly rich output.
def raise_for_hub_error(exc:
HTTPError, *, identifier: str | None = None, endpoint: ResourceEndpoint | Literal[ 'jobs'] | None = None, conflict_message: str | None = None) -> NoReturn:
¶
Translate a requests HTTPError into an SDK-specific
exception.
Poll a HubAI job until it completes or fails.
| Parameters | |
jobstr | HubAI job ID. |
| Returns | |
JobMessageResponse | The completed job response. |
| Raises | |
HubApiError | If the job fails or ends in a terminal non-success status. |