Skip to content

Commit 32ee061

Browse files
deependujhaBorda
andauthored
Update src/lightning/pytorch/callbacks/progress/rich_progress.py
Co-authored-by: Jirka Borovec <[email protected]>
1 parent ad6325b commit 32ee061

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lightning/pytorch/callbacks/progress/rich_progress.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,8 @@ def _init_progress(self, trainer: "pl.Trainer") -> None:
338338
# because it now only pops one Live instance instead of clearing them all.
339339
# We check for `_live_stack` and clear it manually for compatibility across
340340
# both old and new Rich versions.
341-
if hasattr(self._console, "_live_stack"):
342-
if len(self._console._live_stack) > 0:
343-
self._console.clear_live()
341+
if getattr(self._console, "_live_stack", 0) > 0:
342+
self._console.clear_live()
344343
else:
345344
self._console.clear_live()
346345

0 commit comments

Comments
 (0)