From 84354dab7e298a86fd07ebc80d08f4e1ecdad037 Mon Sep 17 00:00:00 2001 From: Lengyue Date: Sun, 7 Apr 2024 00:32:10 -0400 Subject: [PATCH] Lint --- fish_vocoder/modules/discriminators/mpd.py | 2 +- fish_vocoder/modules/discriminators/mrd.py | 2 +- fish_vocoder/modules/encoders/convnext.py | 5 ++--- fish_vocoder/modules/generators/hifigan.py | 1 - fish_vocoder/modules/generators/unify.py | 6 +++--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fish_vocoder/modules/discriminators/mpd.py b/fish_vocoder/modules/discriminators/mpd.py index d4e7cdd..b52f903 100644 --- a/fish_vocoder/modules/discriminators/mpd.py +++ b/fish_vocoder/modules/discriminators/mpd.py @@ -3,7 +3,7 @@ import torch import torch.nn as nn import torch.nn.functional as F -from torch.nn.utils.parametrizations import weight_norm, spectral_norm +from torch.nn.utils.parametrizations import spectral_norm, weight_norm class DiscriminatorP(nn.Module): diff --git a/fish_vocoder/modules/discriminators/mrd.py b/fish_vocoder/modules/discriminators/mrd.py index 9582f8c..419ea18 100644 --- a/fish_vocoder/modules/discriminators/mrd.py +++ b/fish_vocoder/modules/discriminators/mrd.py @@ -1,7 +1,7 @@ import torch import torch.nn as nn import torch.nn.functional as F -from torch.nn.utils.parametrizations import weight_norm, spectral_norm +from torch.nn.utils.parametrizations import spectral_norm, weight_norm class DiscriminatorR(torch.nn.Module): diff --git a/fish_vocoder/modules/encoders/convnext.py b/fish_vocoder/modules/encoders/convnext.py index 0e3fe06..d85d582 100644 --- a/fish_vocoder/modules/encoders/convnext.py +++ b/fish_vocoder/modules/encoders/convnext.py @@ -2,6 +2,7 @@ import torch.nn.functional as F from torch import nn + # DropPath copied from timm library def drop_path( x, drop_prob: float = 0.0, training: bool = False, scale_by_keep: bool = True @@ -176,9 +177,7 @@ def __init__( self.downsample_layers.append(mid_layer) self.stages = nn.ModuleList() - dp_rates = [ - x.item() for x in torch.linspace(0, drop_path_rate, sum(depths)) - ] + dp_rates = [x.item() for x in torch.linspace(0, drop_path_rate, sum(depths))] cur = 0 for i in range(len(depths)): diff --git a/fish_vocoder/modules/generators/hifigan.py b/fish_vocoder/modules/generators/hifigan.py index 7fedd2a..5705dda 100644 --- a/fish_vocoder/modules/generators/hifigan.py +++ b/fish_vocoder/modules/generators/hifigan.py @@ -242,7 +242,6 @@ def forward(self, x, template=None): else: x = self.resblocks[i](x) - x = self.activation_post(x) x = self.conv_post(x) x = torch.tanh(x) diff --git a/fish_vocoder/modules/generators/unify.py b/fish_vocoder/modules/generators/unify.py index 3097dd8..2dd3c30 100644 --- a/fish_vocoder/modules/generators/unify.py +++ b/fish_vocoder/modules/generators/unify.py @@ -4,9 +4,9 @@ class UnifyGenerator(nn.Module): def __init__( - self, - backbone: nn.Module, - head: nn.Module, + self, + backbone: nn.Module, + head: nn.Module, vq: nn.Module | None = None, ): super().__init__()