Skip to content

Commit

Permalink
initialize the default rank set on TrainerState (huggingface#16530)
Browse files Browse the repository at this point in the history
* initialize the default rank set on TrainerState

* fix style
  • Loading branch information
andrescodas authored and stevhliu committed Apr 5, 2022
1 parent b442b33 commit 29a3b42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,11 @@ def __init__(
else:
self.label_smoother = None

self.state = TrainerState()
self.state = TrainerState(
is_local_process_zero=self.is_local_process_zero(),
is_world_process_zero=self.is_world_process_zero(),
)

self.control = TrainerControl()
# Internal variable to count flos in each process, will be accumulated in `self.state.total_flos` then
# returned to 0 every time flos need to be logged
Expand Down

0 comments on commit 29a3b42

Please sign in to comment.