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
6
6
omegaconf >=2.2.3, <2.4.0
7
7
hydra-core >=1.2.0, <1.4.0
8
8
jsonargparse[signatures,jsonnet] >=4.39.0, <4.41.0
9
- rich >=12.3.0, <14.1 .0
9
+ rich >=12.3.0, <14.2 .0
10
10
tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute
11
11
bitsandbytes >=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/).
25
25
26
26
### Fixed
27
27
28
- -
28
+ - fix progress bar console clearing for Rich ` 14.1+ ` ( [ # 21016 ] ( https://github.com/Lightning-AI/pytorch-lightning/pull/21016 ) )
29
29
30
30
31
31
---
Original file line number Diff line number Diff line change @@ -331,7 +331,19 @@ def _init_progress(self, trainer: "pl.Trainer") -> None:
331
331
self ._reset_progress_bar_ids ()
332
332
reconfigure (** self ._console_kwargs )
333
333
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
+
335
347
self ._metric_component = MetricsTextColumn (
336
348
trainer ,
337
349
self .theme .metrics ,
You can’t perform that action at this time.
0 commit comments