Skip to content

Commit

Permalink
Update RMVPE.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Bebra777228 authored Aug 2, 2024
1 parent 8c22903 commit 6fbde59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/infer_pack/predictor/RMVPE.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,11 @@ def __init__(self, model_path, is_half, device=None):
def mel2hidden(self, mel):
with torch.no_grad():
n_frames = mel.shape[-1]
mel = mel.float()
padding = min(32 * ((n_frames - 1) // 32 + 1) - n_frames, n_frames)
mel = F.pad(mel, (0, padding), mode="reflect")
if self.is_half:
mel = mel.half()
hidden = self.model(mel)
return hidden[:, :n_frames]

Expand Down

0 comments on commit 6fbde59

Please sign in to comment.