                  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]")
                      if os.path.isfile(self._gui_preview_trigger):
                          logger.debug("Removing gui trigger file: %s", self._gui_preview_trigger)
                          os.remove(self._gui_preview_trigger)
 
</s> remove                     if os.path.isfile(self._gui_preview_trigger):
                        logger.debug("Removing gui trigger file: %s", self._gui_preview_trigger)
                        os.remove(self._gui_preview_trigger)
 </s> add                     for filename in self._gui_triggers.values():
                        if os.path.isfile(filename):
                            logger.debug("Removing gui trigger file: %s", filename)
                            os.remove(filename)
 </s> remove             if self._toggle_preview_mask:
                trainer.toggle_mask()
                self._toggle_preview_mask = False

 </s> add  </s> remove                     if not preview_trigger_set and os.path.isfile(self._gui_preview_trigger):
 </s> add                     if os.path.isfile(self._gui_triggers["mask_toggle"]):
                        self._toggle_preview_mask = True

                    if not preview_trigger_set and os.path.isfile(self._gui_triggers["update"]): </s> remove     def clear(self):
        """ Remove the trigger file from the cache folder """
        if os.path.isfile(self._trigger_file):
            os.remove(self._trigger_file)
            logger.debug("Removed preview update trigger: %s", self._trigger_file)
 </s> add         Parameters
        ----------
        trigger_type: ["update", "mask_toggle", ``None``], optional
            The trigger to clear. 'update': Full preview update. 'mask_toggle': toggle mask on
            and off. ``None`` - clear all triggers. Default: ``None``
        """
        if trigger_type is None:
            triggers = list(self._trigger_files.values())
        else:
            triggers = [self._trigger_files[trigger_type]]
        for trigger in triggers:
            if os.path.isfile(trigger):
                os.remove(trigger)
                logger.debug("Removed preview trigger: %s", trigger)
                if self._args.redirect_gui:  # Remove any gui trigger files following an update
                  trainer.toggle_mask()
                  self._toggle_preview_mask = False
  
              if self._refresh_preview and viewer is not None:
                if self._args.redirect_gui:  # Remove any gui trigger files following an update
                      print("\n")
                      logger.info("[Preview Updated]")
                      if os.path.isfile(self._gui_preview_trigger):
                          logger.debug("Removing gui trigger file: %s", self._gui_preview_trigger)
                          os.remove(self._gui_preview_trigger)
keep keep keep keep replace keep keep keep keep keep
 Updates
  - Change shortcut key to M
  - Slight optimizations
  - GUI support for mask toggling 
scripts/train.py