fix bug in web demo

This commit is contained in:
hiyouga committed 2023-06-05 17:58:29 +08:00
1 parent 56eb99106a
commit a38d57ddd7
2 files changed
+7 -4

No files matched your search

+2
View File
@@ -49,6 +49,8 @@ class LogCallback(TrainerCallback):
r"""
Event called after logging the last logs.
"""
if "loss" not in state.log_history[-1]:
return
cur_time = time.time()
cur_steps = state.log_history[-1].get("step")
elapsed_time = cur_time - self.start_time