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

Function trainer_monkey_patch

tests/manager/synchronizer_test.py:39–48  ·  view source on GitHub ↗
(train_step_time_list: List[int])

Source from the content-addressed store, hash-verified

37
38
39def trainer_monkey_patch(train_step_time_list: List[int]):
40 async def new_train_step(self: Trainer, exps) -> Dict:
41 self.engine.global_steps += 1
42 self.logger.info(f"Training at step {self.engine.global_steps} started.")
43 time.sleep(train_step_time_list[self.engine.global_steps - 1])
44 metrics = {"actor/step": self.engine.global_steps}
45 self.logger.info(f"Training at step {self.engine.global_steps} finished.")
46 return metrics
47
48 Trainer.train_step = new_train_step
49
50
51def explorer_monkey_patch(explore_step_time_list: List[int]):

Callers 2

run_trainerFunction · 0.85
run_bothFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected