Skip to content

Commit

Permalink
fix wavernn
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed May 21, 2022
1 parent 7b14036 commit b08bcc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
12 changes: 2 additions & 10 deletions mockingbirdforuse/vocoder/wavernn/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ def __init__(self, model_path: Path):
self._model.eval()

def infer_waveform(
self,
mel,
normalize=True,
batched=True,
target=8000,
overlap=800,
progress_callback=None,
self, mel, normalize=True, batched=True, target=8000, overlap=800
):
"""
Infers the waveform of a mel spectrogram output by the synthesizer (the format must match
Expand All @@ -58,7 +52,5 @@ def infer_waveform(
if normalize:
mel = mel / hp.mel_max_abs_value
mel = torch.from_numpy(mel[None, ...])
wav = self._model.generate(
mel, batched, target, overlap, hp.mu_law, progress_callback
)
wav = self._model.generate(mel, batched, target, overlap, hp.mu_law)
return wav, hp.sample_rate
3 changes: 1 addition & 2 deletions mockingbirdforuse/vocoder/wavernn/models/fatchord_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,8 @@ def forward(self, x, mels):
x = F.relu(self.fc2(x))
return self.fc3(x)

def generate(self, mels, batched, target, overlap, mu_law, progress_callback=None):
def generate(self, mels, batched, target, overlap, mu_law):
mu_law = mu_law if self.mode == "RAW" else False
progress_callback = progress_callback or self.gen_display

self.eval()
output = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "MockingBirdForUse"
version = "0.2.1"
version = "0.2.2"
description = ""
authors = ["meetwq <[email protected]>"]

Expand Down

0 comments on commit b08bcc6

Please sign in to comment.