diff --git a/train_sft.py b/train_sft.py index 656eca5..56618bc 100644 --- a/train_sft.py +++ b/train_sft.py @@ -348,7 +348,7 @@ def main() -> None: }, step=step, ) - if _is_better_eval( + if step > 0 and _is_better_eval( printable["success_rate"], printable["chrf"], best_success, @@ -362,6 +362,8 @@ def main() -> None: f"chrf {best_chrf:.2f} -> {best_path}" ) model.train() + if device == "cuda": + torch.cuda.empty_cache() if ckpt_now: _save(last_path, dump()) print(f" last -> {last_path}")