Starwhale Model
A Starwhale Model is a standard format for packaging machine learning models that can be used for various purposes, like model fine-tuning, model evaluation, and online serving. A Starwhale Model contains the model file, inference codes, configuration files, and any other files required to run the model.
Create a Starwhale Modelâ
There are two ways to create a Starwhale Model: by swcli or by Python SDK.
Create a Starwhale Model by swcliâ
To create a Starwhale Model by swcli, you need to define a model.yaml, which describes some required information about the model package, and run the following command:
swcli model build . --model-yaml /path/to/model.yaml
For more information about the command and model.yaml, see the swcli reference. model.yaml is optional for model building.
Create a Starwhale Model by Python SDKâ
from starwhale import model, predict
@predict
def predict_img(data):
   ...
model.build(name="mnist", modules=[predict_img])
Model Managementâ
Model Management by swcliâ
| Command | Description | 
|---|---|
| swcli model list | List all Starwhale Models in a project | 
| swcli model info | Show detail information about a Starwhale Model | 
| swcli model copy | Copy a Starwhale Model to another location | 
| swcli model remove | Remove a Starwhale Model | 
| swcli model recover | Recover a previously removed Starwhale Model | 
Model Management by WebUIâ
Model Historyâ
Starwhale Models are versioned. The general rules about versions are described in Resource versioning in Starwhale.
Model History Management by swcliâ
| Command | Description | 
|---|---|
| swcli model history | List all versions of a Starwhale Model | 
| swcli model info | Show detail information about a Starwhale Model version | 
| swcli model diff | Compare two versions of a Starwhale model | 
| swcli model copy | Copy a Starwhale Model version to a new one | 
| swcli model remove | Remove a Starwhale Model version | 
| swcli model recover | Recover a previously removed Starwhale Model version | 
Model Evaluationâ
Model Evaluation by swcliâ
| Command | Description | 
|---|---|
| swcli model run | Create an evaluation with a Starwhale Model | 
The Storage Formatâ
The Starwhale Model is a tarball file that contains the source directory.