MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / schedule

Method schedule

trinity/explorer/scheduler.py:548–561  ·  view source on GitHub ↗

Schedule the provided tasks. Args: tasks (`List[Task]`): The tasks to schedule. batch_id (`Union[int, str]`): The id of provided tasks. In most cases, it should be current step number for training tasks and " /<eval_ta

(self, tasks: List[Task], batch_id: Union[int, str])

Source from the content-addressed store, hash-verified

546 self.logger.info("Scheduler stopped")
547
548 def schedule(self, tasks: List[Task], batch_id: Union[int, str]) -> None:
549 """Schedule the provided tasks.
550
551 Args:
552 tasks (`List[Task]`): The tasks to schedule.
553 batch_id (`Union[int, str]`):
554 The id of provided tasks. In most cases, it should be current step number for
555 training tasks and "<current_step_num>/<eval_taskset_name>" for eval tasks.
556 """
557 if not tasks:
558 return
559 self.batch_is_eval_map[batch_id] = tasks[0].is_eval
560 self.task_num_map[batch_id] += len(tasks)
561 self._split_and_submit_tasks(tasks, batch_id=batch_id)
562
563 def _split_and_submit_tasks(self, tasks: List[Task], batch_id: Union[int, str]) -> None:
564 for i, task in enumerate(tasks):

Calls 1