mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
parent
704b3f74f9
commit
c38a12270a
@ -2080,7 +2080,8 @@ class Trainer:
|
||||
|
||||
# add remaining tr_loss
|
||||
self._total_loss_scalar += tr_loss.item()
|
||||
train_loss = self._total_loss_scalar / self.state.global_step
|
||||
effective_global_step = max(self.state.global_step, 0.001) # Avoid ZeroDivisionError
|
||||
train_loss = self._total_loss_scalar / effective_global_step
|
||||
|
||||
metrics = speed_metrics(
|
||||
"train",
|
||||
|
Loading…
Reference in New Issue
Block a user