TrainResult
from modal_training_gym.common.train_result import TrainResultResult 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
Section titled “checkpoints”checkpoints() -> list[Checkpoint]List this run’s checkpoints.
Returns
This run’s Checkpoint objects.
from_training_run_id
Section titled “from_training_run_id”from_training_run_id(training_run_id: str) -> TrainResultLoad a TrainResult by training_run_id.
Returns
The persisted TrainResult.
Raises
KeyError: The giventraining_run_idisn’t in the store.
load(training_run_id: str) -> TrainResultAlias for from_training_run_id.
model: ModelConfigBuild 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
Section titled “volume”volume() -> VolumeOpen or create the checkpoints volume.
Returns
The Modal checkpoints Volume.