mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Change ProgressCallback to use dynamic_ncols=True (#24101)
* Change ProgressCallback to use dynamic_ncols=True
* style: make style
* Revert "style: make style"
This reverts commit dee484904c
.
* run make style only trainer_callback
This commit is contained in:
parent
93f73a3848
commit
ba64ec07bb
@ -473,7 +473,7 @@ class ProgressCallback(TrainerCallback):
|
||||
|
||||
def on_train_begin(self, args, state, control, **kwargs):
|
||||
if state.is_local_process_zero:
|
||||
self.training_bar = tqdm(total=state.max_steps)
|
||||
self.training_bar = tqdm(total=state.max_steps, dynamic_ncols=True)
|
||||
self.current_step = 0
|
||||
|
||||
def on_step_end(self, args, state, control, **kwargs):
|
||||
@ -484,7 +484,9 @@ class ProgressCallback(TrainerCallback):
|
||||
def on_prediction_step(self, args, state, control, eval_dataloader=None, **kwargs):
|
||||
if state.is_local_process_zero and has_length(eval_dataloader):
|
||||
if self.prediction_bar is None:
|
||||
self.prediction_bar = tqdm(total=len(eval_dataloader), leave=self.training_bar is None)
|
||||
self.prediction_bar = tqdm(
|
||||
total=len(eval_dataloader), leave=self.training_bar is None, dynamic_ncols=True
|
||||
)
|
||||
self.prediction_bar.update(1)
|
||||
|
||||
def on_evaluate(self, args, state, control, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user