Skip to content

Commit

Permalink
fix(utils): fix latest_checkpoint_path (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
34j committed Mar 22, 2023
1 parent 12d1ba2 commit 00b9f4a
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 @@ -476,7 +476,9 @@ def summarize(


def latest_checkpoint_path(dir_path: Path | str, regex: str = "G_*.pth"):
return list(sorted(Path(dir_path).glob(regex)))[-1]
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]


def plot_spectrogram_to_numpy(spectrogram):
Expand Down

0 comments on commit 00b9f4a

Please sign in to comment.