From 0a093e1c3f4aa89060e48a5aeb627b2b6f086c91 Mon Sep 17 00:00:00 2001 From: yh_cc Date: Mon, 11 Apr 2022 00:35:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3rich=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E9=9A=90=E8=97=8Fcursor?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/utils/rich_progress.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fastNLP/core/utils/rich_progress.py b/fastNLP/core/utils/rich_progress.py index 20330d02..256cc906 100644 --- a/fastNLP/core/utils/rich_progress.py +++ b/fastNLP/core/utils/rich_progress.py @@ -96,6 +96,7 @@ class FRichProgress(Progress, metaclass=Singleton): # start new self.start() + self.console.show_cursor(show=True) return self def set_transient(self, transient: bool = True): @@ -149,6 +150,9 @@ class FRichProgress(Progress, metaclass=Singleton): super().stop_task(task_id) super().remove_task(task_id) + def start(self) -> None: + super().start() + self.console.show_cursor(show=True) if (sys.stdin and sys.stdin.isatty()) and get_global_rank() == 0: f_rich_progress = FRichProgress().new_progess( @@ -161,7 +165,7 @@ if (sys.stdin and sys.stdin.isatty()) and get_global_rank() == 0: TextColumn("{task.fields[post_desc]}", justify="right"), transient=True, disable=False, - speed_estimate_period=10 + speed_estimate_period=1 ) else: f_rich_progress = DummyFRichProgress()