File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ matplotlib>3.1, <3.10.0
66omegaconf >=2.2.3, <2.4.0
77hydra-core >=1.2.0, <1.4.0
88jsonargparse[signatures,jsonnet] >=4.39.0, <4.41.0
9- rich >=12.3.0, <14.1 .0
9+ rich >=12.3.0, <14.2 .0
1010tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute
1111bitsandbytes >=0.45.2,<0.47.0; platform_system != "Darwin"
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2525
2626### Fixed
2727
28- -
28+ - fix progress bar console clearing for Rich ` 14.1+ ` ( [ # 21016 ] ( https://github.com/Lightning-AI/pytorch-lightning/pull/21016 ) )
2929
3030
3131---
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+ if hasattr (self ._console , "_live_stack" ):
337+ # In recent Rich releases, the internal `_live` variable was replaced with `_live_stack` (a list)
338+ # to support nested Live displays. This broke our original call to `clear_live()`,
339+ # because it now only pops one Live instance instead of clearing them all.
340+ # We check for `_live_stack` and clear it manually for compatibility across
341+ # both old and new Rich versions.
342+ if len (self ._console ._live_stack ) > 0 :
343+ self ._console .clear_live ()
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