@@ -206,14 +206,14 @@ class RichProgressBarTheme:
206
206
207
207
"""
208
208
209
- description : Union [str , "Style" ] = "white "
209
+ description : Union [str , "Style" ] = ""
210
210
progress_bar : Union [str , "Style" ] = "#6206E0"
211
211
progress_bar_finished : Union [str , "Style" ] = "#6206E0"
212
212
progress_bar_pulse : Union [str , "Style" ] = "#6206E0"
213
- batch_progress : Union [str , "Style" ] = "white "
214
- time : Union [str , "Style" ] = "grey54 "
215
- processing_speed : Union [str , "Style" ] = "grey70 "
216
- metrics : Union [str , "Style" ] = "white "
213
+ batch_progress : Union [str , "Style" ] = ""
214
+ time : Union [str , "Style" ] = "dim "
215
+ processing_speed : Union [str , "Style" ] = "dim underline "
216
+ metrics : Union [str , "Style" ] = "italic "
217
217
metrics_text_delimiter : str = " "
218
218
metrics_format : str = ".3f"
219
219
@@ -280,7 +280,6 @@ def __init__(
280
280
self ._metric_component : Optional [MetricsTextColumn ] = None
281
281
self ._progress_stopped : bool = False
282
282
self .theme = theme
283
- self ._update_for_light_colab_theme ()
284
283
285
284
@property
286
285
def refresh_rate (self ) -> float :
@@ -318,13 +317,6 @@ def test_progress_bar(self) -> "Task":
318
317
assert self .test_progress_bar_id is not None
319
318
return self .progress .tasks [self .test_progress_bar_id ]
320
319
321
- def _update_for_light_colab_theme (self ) -> None :
322
- if _detect_light_colab_theme ():
323
- attributes = ["description" , "batch_progress" , "metrics" ]
324
- for attr in attributes :
325
- if getattr (self .theme , attr ) == "white" :
326
- setattr (self .theme , attr , "black" )
327
-
328
320
@override
329
321
def disable (self ) -> None :
330
322
self ._enabled = False
@@ -449,7 +441,7 @@ def on_validation_batch_start(
449
441
def _add_task (self , total_batches : Union [int , float ], description : str , visible : bool = True ) -> "TaskID" :
450
442
assert self .progress is not None
451
443
return self .progress .add_task (
452
- f"[{ self .theme .description } ]{ description } " ,
444
+ f"[{ self .theme .description } ]{ description } " if self . theme . description else description ,
453
445
total = total_batches ,
454
446
visible = visible ,
455
447
)
@@ -656,20 +648,3 @@ def __getstate__(self) -> Dict:
656
648
state ["progress" ] = None
657
649
state ["_console" ] = None
658
650
return state
659
-
660
-
661
- def _detect_light_colab_theme () -> bool :
662
- """Detect if it's light theme in Colab."""
663
- try :
664
- import get_ipython
665
- except (NameError , ModuleNotFoundError ):
666
- return False
667
- ipython = get_ipython ()
668
- if "google.colab" in str (ipython .__class__ ):
669
- try :
670
- from google .colab import output
671
-
672
- return output .eval_js ('document.documentElement.matches("[theme=light]")' )
673
- except ModuleNotFoundError :
674
- return False
675
- return False
0 commit comments