Skip to content
Repo

TrainingRun

from modal_training_gym.common.run import TrainingRun

A launched training run that can be inspected, awaited, or loaded by ID.

Attributes

training_run_id str

modal_app_id str

Default: ""

modal_app_url str

Default: ""

framework Framework

config Any

dataset_id str

Default: ""

deployment_id str

Default: ""

status TrainingRunStatus

Default: running

framework_status SlimeStatus | MilesStatus | None

created_at int

Default: 0

started_at int

Default: 0

ended_at int | None

completed_at int | None

updated_at int

Default: 0

duration_seconds int | None

step_times dict[str, dict[str, int | None]] | None

substep_times dict[str, dict[str, dict[str, float | int | bool | None]]] | None

error_message str | None

metadata dict[str, Any] | None

function_call_id str

Default: ""

apply_framework_status(update: FrameworkStatusUpdate) -> FrameworkStatus | None

Apply a framework status update without saving the run.

Returns

The resolved status, or None for an invalid phase.

from_id(run_id: str, *, is_async: bool = False) -> TrainingRun | Awaitable[TrainingRun]
from_stored_data(data: object) -> TrainingRun

Build a run from persisted data and snapshot its metadata keys.

function_call: Any
group_id: str | None

The sweep ID stored in metadata.

record_latest_rollout(rollout: TrainingRolloutResult) -> None

Store the saved rollout summary in this run’s metadata.

result(*, timeout: float | None = None, stop_app_on_success: bool = True) -> TrainResult

Wait for this training run to finish.

Parameters

timeout float | None

Maximum number of seconds to wait.

stop_app_on_success bool

Stop the Modal app after successful training. Default: True

Returns

The completed training result.

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