          os.rename(self.model_dir, archive_dir)
          os.mkdir(self.model_dir)
          new_model = self.build_model(self._get_inputs())
          for model_name, layer_name in legacy_mapping.items():
              old_model = load_model(os.path.join(archive_dir, model_name), compile=False)
              layer = [layer for layer in new_model.layers if layer.name == layer_name]
              if not layer:
                  logger.warning("Skipping legacy weights from '%s'...", model_name)
                  continue
              layer = layer[0]
 
</s> remove             layer = layer[0]
 </s> add             klayer: keras.layers.Layer = layer[0] </s> remove             layer.set_weights(old_model.get_weights())
 </s> add             klayer.set_weights(old_model.get_weights()) </s> remove         for idx, model in enumerate(get_all_sub_models(self._model)):
 </s> add         for idx, model in enumerate(get_all_sub_models(self.model)): </s> remove         new_config = dict()
 </s> add         new_config = {} </s> remove     from tensorflow import pad
 </s> add     from tensorflow import pad  # type:ignore
            old_model: keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                       compile=False)
          os.rename(self.model_dir, archive_dir)
          os.mkdir(self.model_dir)
          new_model = self.build_model(self._get_inputs())
          for model_name, layer_name in legacy_mapping.items():
            old_model: keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                       compile=False)
              layer = [layer for layer in new_model.layers if layer.name == layer_name]
              if not layer:
                  logger.warning("Skipping legacy weights from '%s'...", model_name)
                  continue
              layer = layer[0]
keep keep keep keep replace keep keep keep keep keep
 Core updates
   - Change loss loading mechanism
   - Autosize tooltips based on content size
   - Random linting + code modernisation 
plugins/train/model/_base/model.py