From 577d77fb39678f877d1ef0e3c3b22fc2d65e8a15 Mon Sep 17 00:00:00 2001 From: Thara Palanivel <130496890+tharapalanivel@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:00:17 -0700 Subject: [PATCH] Fix copying over logs Signed-off-by: Thara Palanivel <130496890+tharapalanivel@users.noreply.github.com> --- build/launch_training.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build/launch_training.py b/build/launch_training.py index 981b9d226..143987ad6 100644 --- a/build/launch_training.py +++ b/build/launch_training.py @@ -106,11 +106,12 @@ def main(): dirs_exist_ok=True, ) - # copy over logs - shutil.copy( - os.path.join(training_args.output_dir, sft_trainer.TRAINING_LOGS_FILENAME), - original_output_dir, + # copy over any loss logs + train_logs_filepath = os.path.join( + training_args.output_dir, sft_trainer.TRAINING_LOGS_FILENAME ) + if os.path.exists(train_logs_filepath): + shutil.copy(train_logs_filepath, original_output_dir) if __name__ == "__main__":