From 2311a35c36315123c87b7f20dde3c4dda723bea3 Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Wed, 19 Apr 2023 16:22:38 +0200 Subject: [PATCH] fix(train): don't save model when tuning for auto batch size --- src/so_vits_svc_fork/train.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/so_vits_svc_fork/train.py b/src/so_vits_svc_fork/train.py index 455503df..925f1ee4 100644 --- a/src/so_vits_svc_fork/train.py +++ b/src/so_vits_svc_fork/train.py @@ -254,7 +254,8 @@ def stft( torch.stft = stft def on_train_end(self) -> None: - self.save_checkpoints(adjust=0) + if not self.tuning: + self.save_checkpoints(adjust=0) def save_checkpoints(self, adjust=1): # `on_train_end` will be the actual epoch, not a -1, so we have to call it with `adjust = 0` @@ -546,5 +547,5 @@ def validation_step(self, batch, batch_idx): ) def on_validation_end(self) -> None: - if not self.trainer.sanity_checking: + if not self.trainer.sanity_checking and not self.tuning: self.save_checkpoints()