trinity.explorer.workflow_runner module#
The Workflow Runner Module.
- class trinity.explorer.workflow_runner.Status(ok: bool, metrics: List[Dict[str, float]], message: str | None = None)[source]#
Bases:
objectStatus of the task running result.
- ok: bool#
- metrics: List[Dict[str, float]]#
- message: str | None = None#
- __init__(ok: bool, metrics: List[Dict[str, float]], message: str | None = None) None#
- trinity.explorer.workflow_runner.calculate_run_level_metrics(experiences: List[Experience]) Dict[str, float][source]#
Calculate metrics from experiences.
For non-repeatable workflows, this function will average the metrics from experiences generated by each run, which is equivalent to calculating run level metrics.
For repeatable workflows, please do not use this function.
- class trinity.explorer.workflow_runner.WorkflowRunner(config: Config, model: InferenceModel, auxiliary_models: List[InferenceModel] | None = None, runner_id: int | None = None)[source]#
Bases:
objectA Ray remote actor to run the workflow and generate experiences.
- __init__(config: Config, model: InferenceModel, auxiliary_models: List[InferenceModel] | None = None, runner_id: int | None = None) None[source]#
- async run_task(task: Task, repeat_times: int = 1, run_id_base: int = 0) Tuple[Status, List[Experience]][source]#
Run the task and return the states.