fixed saving by adding a save if there is no improvement
Gitea Actions For AIIA / Explore-Gitea-Actions (push) Successful in 10m52s
Details
Gitea Actions For AIIA / Explore-Gitea-Actions (push) Successful in 10m52s
Details
This commit is contained in:
parent
1cf8b9e09b
commit
358a7c34d0
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue