Skip to content

Commit

Permalink
fix callback
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed Oct 14, 2023
1 parent a63a1ce commit 1e94017
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/llmtuner/extras/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def on_train_begin(self, args: "TrainingArguments", state: "TrainerState", contr
self.in_training = True
self.start_time = time.time()
self.max_steps = state.max_steps
if os.path.exists(os.path.join(args.output_dir, LOG_FILE_NAME)):
if os.path.exists(os.path.join(args.output_dir, LOG_FILE_NAME)) and args.overwrite_output_dir:
logger.warning("Previous log file in this folder will be deleted.")
os.remove(os.path.join(args.output_dir, LOG_FILE_NAME))

Expand Down Expand Up @@ -135,7 +135,7 @@ def on_log(self, args: "TrainingArguments", state: "TrainerState", control: "Tra
remaining_time=self.remaining_time
)
if self.runner is not None:
logger.info("{{'loss': {:.4f}, 'learning_rate': {:.6f}, 'epoch': {:.2f}}}".format(
logger.info("{{'loss': {:.4f}, 'learning_rate': {:2.2e}, 'epoch': {:.2f}}}".format(
logs["loss"], logs["learning_rate"], logs["epoch"]
))

Expand Down

0 comments on commit 1e94017

Please sign in to comment.