Skip to content
Repo

TrainResult

from modal_training_gym.common.train_result import TrainResult

Result metadata and checkpoints for a completed training run.

Attributes

app_name str

Modal app name and default checkpoint volume prefix.

framework Framework

Training framework.

training_run_id str

Run ID and key in the shared results store.

checkpoint_dir str

Checkpoint directory inside the training container. Default: ""

checkpoints_volume_name str

Default: ""

checkpoints_mount_path str

Default: ""

model_config ModelConfig | None

Model used for training.

metrics dict[str, Any]

Default: {}

group_id str

TrainingGroup sweep ID. Default: ""

extra dict[str, Any]

Framework-specific run metadata. Default: {}

checkpoints() -> list[Checkpoint]

List this run’s checkpoints.

Returns

This run’s Checkpoint objects.

from_training_run_id(training_run_id: str) -> TrainResult

Load a TrainResult by training_run_id.

Returns

The persisted TrainResult.

Raises

  • KeyError: The given training_run_id isn’t in the store.
load(training_run_id: str) -> TrainResult

Alias for from_training_run_id.

model: ModelConfig

Build a ModelConfig for this training result.

Returns

A copy whose model_path targets the latest checkpoint, or checkpoint_dir when no checkpoints are recorded.

save(*, is_async: bool = False) -> None | Awaitable[None]
volume() -> Volume

Open or create the checkpoints volume.

Returns

The Modal checkpoints Volume.