mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
set model to training mode before accelerate.prepare (#24520)
This commit is contained in:
parent
06910f5a76
commit
4e8929dcbb
@ -1640,6 +1640,7 @@ class Trainer:
|
||||
|
||||
# prepare using `accelerator` prepare
|
||||
if use_accelerator_prepare:
|
||||
self.model.train()
|
||||
if hasattr(self.lr_scheduler, "step"):
|
||||
if self.use_apex:
|
||||
model = self.accelerator.prepare(self.model)
|
||||
|
Loading…
Reference in New Issue
Block a user