feat: add cur_time to log

This commit is contained in:
wql 2024-09-18 16:11:43 +08:00
parent 8d6f544698
commit cba294f74d
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
# bash run_once.sh lora_sft Qwen-7B 8 50
run_type="$1" run_type="$1"
model="$2" model="$2"
gpu_cnt="$3" gpu_cnt="$3"

View File

@ -303,6 +303,7 @@ class LogCallback(TrainerCallback):
learning_rate=state.log_history[-1].get("learning_rate", None), learning_rate=state.log_history[-1].get("learning_rate", None),
epoch=state.log_history[-1].get("epoch", None), epoch=state.log_history[-1].get("epoch", None),
percentage=round(self.cur_steps / self.max_steps * 100, 2) if self.max_steps != 0 else 100, percentage=round(self.cur_steps / self.max_steps * 100, 2) if self.max_steps != 0 else 100,
cur_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
elapsed_time=self.elapsed_time, elapsed_time=self.elapsed_time,
remaining_time=self.remaining_time, remaining_time=self.remaining_time,
) )