mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-29 17:22:25 +06:00
on_log event should occur *after* the current log is written (#9872)
This commit is contained in:
parent
15e4ce353a
commit
80e4184fb0
@ -680,7 +680,7 @@ class Trainer:
|
|||||||
self,
|
self,
|
||||||
resume_from_checkpoint: Optional[str] = None,
|
resume_from_checkpoint: Optional[str] = None,
|
||||||
trial: Union["optuna.Trial", Dict[str, Any]] = None,
|
trial: Union["optuna.Trial", Dict[str, Any]] = None,
|
||||||
**kwargs
|
**kwargs,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Main training entry point.
|
Main training entry point.
|
||||||
@ -1248,9 +1248,9 @@ class Trainer:
|
|||||||
if self.state.epoch is not None:
|
if self.state.epoch is not None:
|
||||||
logs["epoch"] = round(self.state.epoch, 2)
|
logs["epoch"] = round(self.state.epoch, 2)
|
||||||
|
|
||||||
self.control = self.callback_handler.on_log(self.args, self.state, self.control, logs)
|
|
||||||
output = {**logs, **{"step": self.state.global_step}}
|
output = {**logs, **{"step": self.state.global_step}}
|
||||||
self.state.log_history.append(output)
|
self.state.log_history.append(output)
|
||||||
|
self.control = self.callback_handler.on_log(self.args, self.state, self.control, logs)
|
||||||
|
|
||||||
def _prepare_inputs(self, inputs: Dict[str, Union[torch.Tensor, Any]]) -> Dict[str, Union[torch.Tensor, Any]]:
|
def _prepare_inputs(self, inputs: Dict[str, Union[torch.Tensor, Any]]) -> Dict[str, Union[torch.Tensor, Any]]:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user