nat.plugins.openpipe.trajectory_builder#

Attributes#

Classes#

ARTTrajectoryBuilder

Trajectory builder for the ART backend.

Module Contents#

logger#
class ARTTrajectoryBuilder(
trajectory_builder_config: nat.plugins.openpipe.config.ARTTrajectoryBuilderConfig,
)#

Bases: nat.finetuning.interfaces.trajectory_builder.TrajectoryBuilder

Trajectory builder for the ART backend.

evaluation_runs: dict[str, list[asyncio.Task[nat.eval.config.EvaluationRunOutput]]]#
property num_generations: int#
async start_run(run_id: str, meta: dict | None = None) None#

Start multiple evaluation runs to collect trajectories.

Args:

run_id (str): The ID of the run. meta (dict): Metadata for the run.

async finalize(
run_id: str,
meta: dict | None = None,
) nat.data_models.finetuning.TrajectoryCollection#

Waits for all evaluation runs to finalize and builds trajectories from the episode items, grouping them by example ID.

Args:

run_id (str): The ID of the run. meta (dict): Metadata for the run.

Returns:

TrajectoryCollection: The collection of built trajectories grouped by example.

log_progress(
run_id: str,
metrics: dict[str, Any],
output_dir: str | None = None,
) None#

Log trajectory building progress.

Args:

run_id: The training run ID metrics: Dictionary of metrics to log output_dir: Optional output directory override