Export checkpoints from the Model Hub
SambaStudio allows users to export any checkpoint they have published to the Model Hub.
SambaNova owned models cannot be exported from the platform. |
Export using the CLI
You can use SambaNova API (SNAPI), the SambaStudio command-line interface (CLI), to export models from the Model Hub.
Run snapi model export --help to display available options and usage for exporting using the CLI.
$ snapi model export --help
Usage: snapi model export [OPTIONS]
Export a model checkpoint to a specified destination.
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ * --model-id -m TEXT Model ID [default: None] [required] │
│ * --destination -dest TEXT Type of destination. Currently only 'local and NFS' │
│ is supported. │
│ [default: None] │
│ [required] │
│ --path -p TEXT Path for local destination [default: None] │
│ --use-rclone Use RClone to download the model. RClone must be │
│ installed on the system. Installation link: │
│ https://rclone.org/downloads/ │
│ --parallel-downloads INTEGER Number of files to download in parallel to enhance │
│ the download speed. │
│ [default: 4] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
SNAPI model export command
Use the snapi model export command to export a model. It supports downloading the model to a local machine or other specified destinations.
You can view and copy the model-id, the destination type, and the path directly from the model card of your model.
-
Select your model to view its model card.
-
In the model card, click Export to the right of the model name. The Export model box will open.
-
Select the SNAPI tab.
-
Copy the command using the copy icon, as shown in Figure 1, and then run it. The following will be specified for the snapi model export command:
-
The model-id, which is its unique identifier. We used
ba5de2fc-0cb6-4e5b-a7fa-1935cd6e531c
in our example below. -
The destination type. This can be local or NFS. We used
local
in our example below, which would download the model to our local system. -
The path, which defines the local directory and file name for saving the exported model. We used
./model-ba5de2fc-0cb6-4e5b-a7fa-1935cd6e531c
in our example below.
-
$ snapi model export \
--model-id ba5de2fc-0cb6-4e5b-a7fa-1935cd6e531c \
--destination local \
--path ./model-ba5de2fc-0cb6-4e5b-a7fa-1935cd6e531c
Export models using rclone
The use-rclone option allows you to leverage rclone for model exports, enhancing performance, reliability, and resumption capabilities of interrupted downloads. You can use it to streamlines the process of saving models locally for offline use, further development, or integration into external systems.
The use-rclone option optimizes the model export process by:
-
Supporting large file transfers efficiently.
-
Allowing resumable downloads in case of interruptions.
-
Improving overall transfer speed by leveraging rclone’s capabilities.
Requirements
Please ensure the following requirements are met before using rclone.
-
Ensure that rclone is installed and properly configured on your system. Please see the rclone install guide for more information.
-
Keep rclone updated to the latest version for optimal performance.
-
-
Confirm the model-id exists and that you have permissions to export the model.
-
Ensure that you are the Owner or a Collaborator of the model from the model share settings to successfully export it.
-
Confirm sufficient disk space is available at the specified --path.
Example SNAPI rclone command
The example below demonstrates the use-rclone option with the snapi model export command. You can specify the following:
-
The model-id, which is its unique identifier. We used
97ea373f-498e-4ede-822e-a34a88693a09
in our example below. -
The destination type. This can be local or NFS. We used
local
in our example below, which would download the model to our local system. -
The path, which defines the local directory and file name for saving the exported model. We used
./models/
in our example below. -
The use-rclone option, which enables rclone to be used for the backend when downloading model files.
$ snapi model export \
--model-id '97ea373f-498e-4ede-822e-a34a88693a09' \
--destination 'local' \
--path ./models/ \
--use-rclone
CLI export checkpoint error messages
This section describes the most common issues encountered when exporting a checkpoint from the Model Hub using the CLI.
Model not found
This error occurs when the specified model-id does not exist in the system. Possible causes:
-
Typographical errors in the model-id.
-
The model has been deleted or is unavailable.
Exporting this model is not permitted
This error occurs in the following scenarios:
-
Insufficient permissions: The user is not assigned Collaborator access to the model.
-
SambaNova provided models: Exporting these models is not permitted.
-
The credentials used to download the model have expired due to prolonged delays or interruptions.
Model files are unavailable
This error occurs when the model is not in an available state. This can happen if:
-
The model has not been downloaded onto the Studio platform.
-
There was an issue during its creation.
Model download was interrupted
This message appears when the download process is interrupted by the user.
The required tool rclone is not installed
This message appears when users attempt to export a model using rclone but the tool is not installed.
Steps to take
Install rclone as described in the Requirements section.
Export using the GUI
Follow the steps below to export a model using the SambaStudio GUI.
-
Select your model to view its model card.
-
In the model card, click Export to the right of the model name. The Export model box will open.
-
Select the NFS tab.
Figure 2. Export model NFS -
Click Continue. The Export model box will display the source path to the exported model’s checkpoint. Copy the path displayed in Exported model path.
-
Click Done to complete the export process.
Figure 3. Export model NFS path