fixed saving by adding a save if there is no improvement
Gitea Actions For AIIA / Explore-Gitea-Actions (push) Successful in 10m52s Details

This commit is contained in:
Falko Victor Habel 2025-06-30 09:54:07 +02:00
parent 1cf8b9e09b
commit 358a7c34d0
1 changed files with 3 additions and 1 deletions

View File

@ -309,7 +309,9 @@ class aiuNNTrainer:
# Cleanup
gc.collect()
torch.cuda.empty_cache()
if not is_improved:
best_model_path = os.path.join(output_path, "final_model")
self.model.save_pretrained(best_model_path)
return self.best_loss
def load_checkpoint(self, specific_checkpoint=None):