Skip to content

Commit

Permalink
fix(train): don't save model when tuning for auto batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordmau5 authored Apr 19, 2023
1 parent 1ddb7ed commit 2311a35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/so_vits_svc_fork/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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()

0 comments on commit 2311a35

Please sign in to comment.