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.

Example SNAPI model help command
$ 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.

  1. Select your model to view its model card.

  2. In the model card, click Export to the right of the model name. The Export model box will open.

  3. Select the SNAPI tab.

  4. 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.

Example SNAPI model export command
$ snapi model export \
  --model-id ba5de2fc-0cb6-4e5b-a7fa-1935cd6e531c \
  --destination local \
  --path ./model-ba5de2fc-0cb6-4e5b-a7fa-1935cd6e531c
Export model snapi
Figure 1. Example export model SNAPI

Output

Upon successful execution, the model will be saved at the specified path on the user’s local machine. Any errors or progress updates will be displayed in the terminal.

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:

  1. Supporting large file transfers efficiently.

  2. Allowing resumable downloads in case of interruptions.

  3. Improving overall transfer speed by leveraging rclone’s capabilities.

Requirements

Please ensure the following requirements are met before using rclone.

  1. Ensure that rclone is installed and properly configured on your system. Please see the rclone install guide External link for more information.

    1. Keep rclone updated to the latest version for optimal performance.

  2. Confirm the model-id exists and that you have permissions to export the model.

  3. Ensure that you are the Owner or a Collaborator of the model from the model share settings to successfully export it.

  4. 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.

Example snapi model export command using rclone
$ 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.

Example message

Model not found. Please refer to the Export Model Documentation or contact your Administrator for assistance.

Steps to take

  • Verify the model-id for accuracy.

  • Contact your Administrator if the issue persists.

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.

Example message

Exporting this model is not permitted. Please refer to the Export Model Documentation or contact your Administrator for assistance.

Steps to take

  • For permission issues, request the model Owner or and Administrator to add you as a Collaborator.

  • Reinitiate the export process to obtain fresh credentials.

  • Contact your Administrator if the issue persists.

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.

Example message

Model files are unavailable. Please refer to the Export Model Documentation or contact your Administrator for assistance.

Steps to take

  • Wait until the model becomes available.

  • Contact your Administrator if the issue persists.

Model download was interrupted

This message appears when the download process is interrupted by the user.

Example message

Model download was interrupted. Please re-trigger the export to continue.

Steps to take

  • Reinitiate the export process to continue downloading the model.

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.

Example message

The required tool rclone is not installed. Please install rclone and try again.

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.

  1. Select your model to view its model card.

  2. In the model card, click Export to the right of the model name. The Export model box will open.

  3. Select the NFS tab.

    Export model
    Figure 2. Export model NFS
  4. 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.

  5. Click Done to complete the export process.

    Export model path
    Figure 3. Export model NFS path