Skip to main content

Chariot Models

Chariot-native models have been trained within Chariot using one of the training wizards. These models contain comprehensive metadata and are optimized for seamless integration within the Chariot ecosystem.

File Format Requirements

Chariot models require a .tar.gz archive file containing:

  • Model weights (.pth file)
  • .chariot/ directory containing
    • Configuration file (model.json)
    • Optional drift detectors

Import Example

Since a Chariot model has a config file containing the class labels (if the model requires them), they do not need to be explicitly defined during import.

Chariot models can be imported as a tar.gz file specified using the model_path parameter of import_model. A Chariot model is exported from Chariot with a tar.gz format, allowing you to import the tar file directly to another instance of Chariot without having to extract its contents first.

Given a Chariot tar.gz file, here is an example of how you would import the model:

from chariot.models import import_model, ArtifactType, TaskType

# This is the path to the model tar file to upload.
model_path = "/path/to/chariot/model.tar.gz"

# This will create a new model entry in the catalog, at the project and name specified.
model = import_model(
name="<NAME OF MODEL>",
# one of `project_id` or `project_name` is required
project_id="<PROJECT ID>",
project_name="<PROJECT NAME>",
version="<MODEL VERSION>",
artifact_type=ArtifactType.CHARIOT,
task_type=TaskType.IMAGE_CLASSIFICATION,
summary=f"testing Chariot model import",
model_path=model_path,
)