              # Set initial timestamp
              self.train_stats["timestamp"] = time()
  
          iterations += 1
          self.train_stats["iterations"] = iterations
  
          elapsed = self.calc_elapsed()
          message = (f"Elapsed: {elapsed} | "
                     f"Session Iterations: {self.train_stats['iterations']}  {message}")
          self.statusbar.progress_update(message, 0, False)
 
</s> remove         elapsed = self.calc_elapsed()
 </s> add         elapsed = self._calculate_elapsed() </s> remove                    f"Session Iterations: {self.train_stats['iterations']}  {message}")
        self.statusbar.progress_update(message, 0, False)
        logger.trace("Succesfully captured loss: %s", message)
 </s> add                    f"Session Iterations: {self._train_stats['iterations']}  {message}")
        self._statusbar.progress_update(message, 0, False)
        logger.trace("Succesfully captured loss: %s", message)  # type:ignore[attr-defined] </s> remove             self.train_stats["timestamp"] = time()
 </s> add             self._train_stats["timestamp"] = time() </s> remove         iterations = self.train_stats["iterations"]
 </s> add         iterations = self._train_stats["iterations"]
        assert isinstance(iterations, int) </s> remove             logger.trace("Error creating loss message. Returning False")
 </s> add             logger.trace(  # type:ignore[attr-defined]
                "Error creating loss message. Returning False")
        self._train_stats["iterations"] = iterations
              # Set initial timestamp
              self.train_stats["timestamp"] = time()
  
          iterations += 1
        self._train_stats["iterations"] = iterations
  
          elapsed = self.calc_elapsed()
          message = (f"Elapsed: {elapsed} | "
                     f"Session Iterations: {self.train_stats['iterations']}  {message}")
          self.statusbar.progress_update(message, 0, False)
keep keep keep keep replace keep keep keep keep keep
 bugfix: GUI force stdout/stderr reading to utf-8 
lib/gui/wrapper.py