From b0a42d091ef736cb2069d9a5d11478a449811acd Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Thu, 12 Sep 2024 15:04:21 -0700 Subject: [PATCH] Flush the messages --- llms/mlx_lm/tuner/trainer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llms/mlx_lm/tuner/trainer.py b/llms/mlx_lm/tuner/trainer.py index 397dd07f..dd2a8b67 100644 --- a/llms/mlx_lm/tuner/trainer.py +++ b/llms/mlx_lm/tuner/trainer.py @@ -254,7 +254,8 @@ def train( print( f"Iter {it}: " f"Val loss {val_loss:.3f}, " - f"Val took {val_time:.3f}s" + f"Val took {val_time:.3f}s", + flush=True, ) if training_callback is not None: @@ -292,7 +293,8 @@ def train( f"It/sec {it_sec:.3f}, " f"Tokens/sec {tokens_sec:.3f}, " f"Trained Tokens {trained_tokens}, " - f"Peak mem {peak_mem:.3f} GB" + f"Peak mem {peak_mem:.3f} GB", + flush=True, ) if training_callback is not None: