File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/lightning/pytorch/callbacks/progress Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,19 @@ def _init_progress(self, trainer: "pl.Trainer") -> None:
331331 self ._reset_progress_bar_ids ()
332332 reconfigure (** self ._console_kwargs )
333333 self ._console = get_console ()
334- self ._console .clear_live ()
334+
335+ # Compatibility shim for Rich >= 14.1.0:
336+ # In recent Rich releases, the internal `_live` variable was replaced with `_live_stack` (a list)
337+ # to support nested Live displays. This broke our original call to `clear_live()`,
338+ # because it now only pops one Live instance instead of clearing them all.
339+ # We check for `_live_stack` and clear it manually for compatibility across
340+ # both old and new Rich versions.
341+ if hasattr (self ._console , "_live_stack" ):
342+ if len (self ._console ._live_stack ) > 0 :
343+ self ._console ._live_stack .clear ()
344+ else :
345+ self ._console .clear_live ()
346+
335347 self ._metric_component = MetricsTextColumn (
336348 trainer ,
337349 self .theme .metrics ,
You can’t perform that action at this time.
0 commit comments