Skip to content

Commit

Permalink
feat(utils): log latest checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
34j committed Mar 22, 2023
1 parent 1b38c2d commit 94758c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/so_vits_svc_fork/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ def summarize(
def latest_checkpoint_path(dir_path: Path | str, regex: str = "G_*.pth"):
dir_path = Path(dir_path)
name_key = lambda p: int(re.match(r"._(\d+)\.pth", p.name).group(1))
return list(sorted(dir_path.glob(regex), key=name_key))[-1]
res = list(sorted(dir_path.glob(regex), key=name_key))[-1]
LOG.info(f"Latest checkpoint: {res}")
return res


def plot_spectrogram_to_numpy(spectrogram):
Expand Down

0 comments on commit 94758c3

Please sign in to comment.