code: def on_train_end(self, **kwargs):
          "Load the best model."
  
          if self.save_model:
              # Adapted from fast.ai "SaveModelCallback"
              if self.model_path.is_file():
                  with self.model_path.open('rb') as model_file:
                      self.learn.load(model_file, purge=False)
                      print(f'Loaded best saved model from {self.model_path}'f on_train_end(self, **kwargs):
          "Load the best model."
  
          if self.save_model:
              # Adapted from fast.ai "SaveModelCallback"
              if self.model_path.is_file():
                  with self.model_path.open('rb') as model_file:
                      self.learn.load(model_file, purge=False)
                      print(f'Loaded best saved model from {self.model_path}')
docs: Load the best model.