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

Method save_checkpoint

trinity/trainer/trainer.py:264–277  ·  view source on GitHub ↗
(
        self, block_until_saved: bool = False, save_as_hf: bool = False
    )

Source from the content-addressed store, hash-verified

262 self._sample_exps_to_log.clear()
263
264 async def save_checkpoint(
265 self, block_until_saved: bool = False, save_as_hf: bool = False
266 ) -> Dict:
267 metrics = {}
268 with Timer(metrics, "time/save_checkpoint"):
269 self.logger.info(f"Saving checkpoint at step {self.train_step_num}...")
270 await self.engine.save_checkpoint(
271 block_until_saved=block_until_saved, save_as_hf=save_as_hf
272 )
273 self.state.save_trainer(
274 current_step=self.train_step_num,
275 sample_strategy_state=self.sample_strategy.state_dict(),
276 )
277 return metrics
278
279 async def shutdown(self) -> None:
280 self.monitor.close()

Callers 2

trainMethod · 0.95
new_explore_stepFunction · 0.45

Calls 3

TimerClass · 0.90
save_trainerMethod · 0.80
state_dictMethod · 0.45

Tested by 1

new_explore_stepFunction · 0.36