super().__init__(trainer)
train_cfg = getattr(trainer.args, 'train', None)
ckpt_cfg = getattr(train_cfg, 'checkpoint', None)
if ckpt_cfg is None:
ckpt_cfg = getattr(trainer.args, 'checkpoint', None)
self.enabled = getattr(ckpt_cfg, 'save_hf_weights', False) if ckpt_cfg else False
self.save_steps = getattr(ckpt_cfg, 'save_steps', 0) if ckpt_cfg else 0
self.output_dir = getattr(ckpt_cfg, 'output_dir', 'outputs') if ckpt_cfg else 'outputs'
self._last_saved_step = -1