Workflows automate machine learning tasks, combining GPU instances with an expressive syntax to generate production-ready machine learning pipelines with a few lines of code.
The Gradient Model repository is a hub for importing, managing, and deploying ML models.
You can create Gradient Models in two ways:
Paperspace supports creating the following model formats:
Gradient has a repository of models per project. The model repository holds reference to the model artifacts (files generated during training) as well as optional summary metrics associated with the model’s performance such as accuracy and loss.
If you are creating a Notebook for the first time, the Models section asks you to either UPLOAD MODEL or view our documentation.
You can use the Paperspace UI or CLI to create a model in Gradient either by running a workload that generates a model or by uploading a model.
You can do this using a Gradient Action or the SDK. This places your model in your Project’s model repository. For more information, see the Model CLI/SDK docs.
You can upload models in the model repository via the Paperspace UI or CLI.
To upload a Model via the Paperspace UI, first navigate to the Models page.
From there, click Upload a Model +.
This opens up a window to Upload a Model, where you can select a model file or directory from your local machine. You also choose the model Type, and provide a Name, custom Summary, and any Additional Notes as metadata.
Then click Upload Model. This uploads and registers the model in Gradient.
You can upload a model via the CLI with the gradient models upload
subcommand:
gradient models upload downloads/squeezenet1.1.onnx --name squeezenet --modelType ONNX
Now that you have a model, read on to learn how you can use it to create a Deployment.
You can view your team’s models in the model repository via the Paperspace UI or CLI.
In the Paperspace UI, click the Models tab to see your list of trained models:
The Paperspace UI view shows your model ID, when the model was created, the S3 bucket location of your model, your metrics summary data, the model type, and whether it is currently deployed on Paperspace.
You can click Deploy Model to create a deployment with your model. You can also click Open Detail to view or download the model’s performance metrics, a list of all of the checkpoint files (artifacts) generated by the final model.
Alternately, you can view your models via the CLI by running gradient models list
. Currently, the CLI only let’s you view each model in the project space’s ID and name when this is called.
You can view your models via the CLI by running gradient models list
.
$ gradient models list
+------+-----------------+------------+------------+
| Name | ID | Model Type | Project ID |
+------+-----------------+------------+------------+
| None | moilact08jpaok | Tensorflow | prcl68pnk |
| None | mos2uhkg4yvga0p | Tensorflow | prcl68pnk |
| None | moc7i8v6bsrhzk | Custom | prddziv0z |
You can use the --projectId
flag to filter the list by Project ID.
If you want to rename your model, click your model’s name and type your new model name. If you want to delete the model, it depends on whether your interface is a Paperspace UI or CLI.
Click the Models tab to view your list of trained models. From here, you can delete models by clicking the Delete button.
You can delete a model using the CLI with the following command:
gradient models delete --id <your-model-id>
A model is successfully deleted if it no output is generated after running the command.
Model Type Values | Description |
---|---|
"Tensorflow" |
TensorFlow compatible model outputs |
"ONNX" |
ONNX model outputs |
"Custom" |
Custom model type (for example, a Flask server) |
If you do not specify modelType
, you can associate custom model metadata with the model by creating a gradient-model-metadata.json file in the modelPath
directory. You can store any valid JSON data in this file.