def resume_training(self, learner, callbacks, metrics) -> api.TrainingInfo:
if self.model_config.continue_training:<EOL><INDENT>start_epoch = self.storage.last_epoch_idx()<EOL><DEDENT>else:<EOL><INDENT>start_epoch = <NUM_LIT:0><EOL><DEDENT>training_info = api.TrainingInfo(<EOL>start_epoch_idx=start_epoch,<EOL>run_name=self.model_config.run_name,<EOL>metrics=metrics,<EOL>callbacks=callbacks<EOL>)<EOL>if start_epoch == <NUM_LIT:0>:<EOL><INDENT>self.storage.reset(self.model_config.render_configuration())<EOL>training_info.initialize()<EOL>learner.initialize_training(training_info)<EOL><DEDENT>else:<EOL><INDENT>model_state, hidden_state = self.storage.load(training_info)<EOL>learner.initialize_training(training_info, model_state, hidden_state)<EOL><DEDENT>return training_info<EOL>
Possibly resume training from a saved state from the storage