From 65676c0aaefacff0dfbfb7e1785dda516460d9eb Mon Sep 17 00:00:00 2001
From: Yabin Li <wucong.lyb@alibaba-inc.com>
Date: 星期一, 18 十二月 2023 09:39:47 +0800
Subject: [PATCH] Update readme.md

---
 funasr/train/trainer.py |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/funasr/train/trainer.py b/funasr/train/trainer.py
index a25f39a..a5069d0 100644
--- a/funasr/train/trainer.py
+++ b/funasr/train/trainer.py
@@ -278,14 +278,11 @@
         for iepoch in range(start_epoch, trainer_options.max_epoch + 1):
             if iepoch != start_epoch:
                 logging.info(
-                    "{}/{}epoch started. Estimated time to finish: {}".format(
+                    "{}/{}epoch started. Estimated time to finish: {} hours".format(
                         iepoch,
                         trainer_options.max_epoch,
-                        humanfriendly.format_timespan(
-                            (time.perf_counter() - start_time)
-                            / (iepoch - start_epoch)
-                            * (trainer_options.max_epoch - iepoch + 1)
-                        ),
+                        (time.perf_counter() - start_time) / 3600.0 / (iepoch - start_epoch) * (
+                                trainer_options.max_epoch - iepoch + 1),
                     )
                 )
             else:
@@ -369,7 +366,7 @@
                             ],
                             "scaler": scaler.state_dict() if scaler is not None else None,
                             "ema_model": model.encoder.ema.model.state_dict()
-                            if hasattr(model.encoder, "ema") and model.encoder.ema is not None else None,
+                            if hasattr(model, "encoder") and hasattr(model.encoder, "ema") and model.encoder.ema is not None else None,
                         },
                         buffer,
                     )

--
Gitblit v1.9.1