Skip to content

Commit 2e9902c

Browse files
committed
fix train loss
1 parent d8ddba9 commit 2e9902c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

paddlenlp/trainer/trainer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2699,7 +2699,13 @@ def log(self, logs: Dict[str, float], **kwargs) -> None:
26992699

27002700
if self.state.epoch is not None:
27012701
logs["progress_or_epoch"] = round(self.state.epoch, 4)
2702-
self.state.log_history = []
2702+
2703+
if strtobool(os.getenv("FLAG_INTERNAL_USAGE", "False")):
2704+
self.state.log_history = []
2705+
else:
2706+
output = {**logs, **{"step": self.state.global_step}}
2707+
self.state.log_history.append(output)
2708+
27032709
self.control = self.callback_handler.on_log(self.args, self.state, self.control, logs, **kwargs)
27042710

27052711
def evaluate(

0 commit comments

Comments
 (0)