Model

class Model(owner, model_id, date, model_type, name, model, verbose, producer)

Neural network model object.

A model should not be constructed directly. It is constructed by the hub client through qai_hub.upload_model(), qai_hub.get_model(), or qai_hub.get_models().

model_id

The model ID.

Type:

str

date

The time this model was uploaded.

Type:

datetime

model_type

The type of the model.

Type:

SourceModelType

name

An optional user-provided name to identify the model.

Type:

str

download(filename=None)

Downloads source model either to memory or to file.

Parameters:

filename (Optional[str]) –

If filename is specified the model is downloaded to file, otherwise to memory.

Note for Windows: If the model is a Core ML model, filename must be specified, because Core ML currently cannot load mlmodel in-memory on Windows.

Returns:

If filename is None, return SourceModel. Otherwise return str.

Return type:

SourceModel | str

download_model(filename=None)

Downloads source model to file.

Return type:

Union[TopLevelTracedModule, MLModel, ModelProto, bytes, str]

Deprecated since version 0.3.0: Please use the ‘download’ API instead.