nat.finetuning.interfaces.trajectory_builder#
Classes#
Abstract interface for building trajectories from episode items. |
Module Contents#
- class TrajectoryBuilder(
- trajectory_builder_config: nat.data_models.finetuning.TrajectoryBuilderConfig,
Bases:
abc.ABCAbstract interface for building trajectories from episode items.
- trajectory_builder_config#
- run_config: nat.data_models.finetuning.FinetuneConfig = None#
- async initialize(
- run_config: nat.data_models.finetuning.FinetuneConfig,
Asynchronously initialize any resources needed for the trajectory builder.
- async run_eval() nat.eval.config.EvaluationRunOutput#
Run NAT Evaluation to generate episode items for trajectory building.
- Returns:
EvaluationRunOutput: The output of the evaluation run.
- abstractmethod start_run(run_id: str, meta: dict | None = None) None#
- Async:
Initialize any resources needed for the trajectory builder.
- Args:
run_id (str): The unique identifier for the training run. meta (dict): Metadata associated with the training run.
- abstractmethod finalize( ) nat.data_models.finetuning.TrajectoryCollection#
- Async:
Finalize the trajectory building process and return the constructed trajectories.
- Args:
run_id (str): The unique identifier for the training run. meta (dict): Metadata associated with the training run.
- Returns:
list[Trajectory]: The list of constructed trajectories.
- async compute_reward(
- output_item: nat.eval.evaluator.evaluator_model.EvalOutputItem,
- meta: dict | None = None,
Compute reward for a given EvalOutputItem.
- Args:
output_item (EvalOutputItem): The evaluation output item. meta (dict): Metadata associated with the training run.
- Returns:
float: The computed reward.