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)[源代码]#
基类:
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][源代码]#
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)[源代码]#
基类:
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[源代码]#
- async run_task(task: Task, repeat_times: int = 1, run_id_base: int = 0) Tuple[Status, List[Experience]][源代码]#
Run the task and return the states.
- class trinity.explorer.workflow_runner.DebugWorkflowRunner(config: Config, output_dir: str = 'debug_output', enable_profiling: bool = False, disable_overwrite: bool = False)[源代码]#
-
A WorkflowRunner for debugging.