Unverified Commit c38a1227 authored by Traun Leyden's avatar Traun Leyden Committed by GitHub
Browse files

Workaround for #27758 to avoid ZeroDivisionError (#28756)

parent 704b3f74
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment