              if self._stop:
                  logger.debug("Stop received. Terminating")
                  break
  
              if self._refresh_preview and viewer is not None:
                  if self._args.redirect_gui:
                      print("\n")
                      logger.info("[Preview Updated]")
 
</s>
            if self._toggle_preview_mask:
                trainer.toggle_mask()
                self._toggle_preview_mask = False

              if self._stop:
                  logger.debug("Stop received. Terminating")
                  break
  
            if self._toggle_preview_mask:
                trainer.toggle_mask()
                self._toggle_preview_mask = False

              if self._refresh_preview and viewer is not None:
                  if self._args.redirect_gui:
                      print("\n")
                      logger.info("[Preview Updated]")
keep keep keep add keep keep keep keep
 - added push t to disable mask display at preview window

trsprmvd

- added extra checks for mask presence in the set
scripts/train.py