Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoeSS Onnx #21

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add files via upload
  • Loading branch information
NaruseMioShirakana committed Feb 19, 2023
commit a0dace19079fd013865014c411c38a8be3cbd162
7 changes: 5 additions & 2 deletions fish_diffusion/denoisers/wavenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ def forward(self, x, diffusion_step, conditioner):
:param conditioner: [B, M, T]
:return:
"""

Onnx = False
if x.dim() == 4:
x = x.squeeze(0)
Onnx = True
assert x.dim() == 3, f"mel must be 3 dim tensor, but got {x.dim()}"

x = self.input_projection(x) # x [B, residual_channel, T]
Expand All @@ -219,4 +222,4 @@ def forward(self, x, diffusion_step, conditioner):
x = F.relu(x)
x = self.output_projection(x) # [B, 128, T]

return x
return x.unsqueeze(0) if Onnx else x