def default_callbacks(self) -> List: callbacks = [] callbacks.append(TrainHandler(self.config)) callbacks.append(LogHandler(self.config)) callbacks.append(GradientClipNorm(self.config)) callbacks.append(Checkpoint(self.config)) return callbacks
def configure_callbacks(self): # Callback # by default set up LogHandler and Checkpointer self.checkpoint_callback = Checkpoint(self.config) self.add_callback(self.checkpoint_callback) if self.rank == 0: self.log_handler = TextRLLogHandler(self.config) self.add_callback(self.log_handler)
def configure_callbacks(self): # Resume callback runs for all ranks self.resume_callback = Resume(self.config) self.add_callback(self.resume_callback) # For logging and inference, use rank 0 by default if self.rank == 0: self.log_callback = TrainLogger(self.config) self.add_callback(self.log_callback) self.eval_callback = Evaluation(self.config) self.add_callback(self.eval_callback) if self.config.training.console: self.console_callback = Console(self.config) self.add_callback(self.console_callback) self.checkpoint_callback = Checkpoint(self.config) self.add_callback(self.checkpoint_callback)
def configure_callbacks(self): # Callback # by default set up LogHandler and Checkpointer self.checkpoint_callback = Checkpoint(self.config) self.add_callback(self.checkpoint_callback)