                      self._errcount += 1
                  else:
                      logger.error("Error reading the preview file for '%s'", img)
                      print(f"Error reading the preview file for {name}")
                      self._previewtrain[name] = None
  
      def _get_current_size(self, name):
          """ Return the size of the currently displayed training preview image.
  
          Parameters
 
</s> remove     def _get_current_size(self, name):
 </s> add     def _get_current_size(self, name: str) -> Optional[Tuple[int, int]]: </s> remove     def load_training_preview(self):
 </s> add     def load_training_preview(self) -> None: </s> remove         image_files = self._get_images(self._pathoutput)
 </s> add         assert self._pathoutput is not None
        image_path = self._get_newest_folder() if self._batch_mode else self._pathoutput
        image_files = self._get_images(image_path) </s> remove     def clear(self, trigger_type=None):
 </s> add     def clear(self, trigger_type: Optional[Literal["update", "mask_toggle"]] = None) -> None:
                    del self._previewtrain[name]
                      self._errcount += 1
                  else:
                      logger.error("Error reading the preview file for '%s'", img)
                      print(f"Error reading the preview file for {name}")
                    del self._previewtrain[name]
  
      def _get_current_size(self, name):
          """ Return the size of the currently displayed training preview image.
  
          Parameters
keep keep keep keep replace keep keep keep keep keep
 Bugfix: Preview for extract in batch mode 
lib/gui/utils.py