From 1e9401744cadecdef043b6f744b2616a74c64bca Mon Sep 17 00:00:00 2001 From: hiyouga Date: Sun, 15 Oct 2023 04:59:44 +0800 Subject: [PATCH] fix callback --- src/llmtuner/extras/callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llmtuner/extras/callbacks.py b/src/llmtuner/extras/callbacks.py index 5117d63d..b2987605 100644 --- a/src/llmtuner/extras/callbacks.py +++ b/src/llmtuner/extras/callbacks.py @@ -66,7 +66,7 @@ class LogCallback(TrainerCallback): 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)) @@ -135,7 +135,7 @@ class LogCallback(TrainerCallback): 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"] ))