From d57345579200d3f0264daad6acd2a20ffbee62d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 25 Jan 2025 19:26:51 +0000 Subject: [PATCH] chore(format): run black on main --- rvc/lib/algorithm/generators/refinegan.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rvc/lib/algorithm/generators/refinegan.py b/rvc/lib/algorithm/generators/refinegan.py index 432a33ef..f571cfa5 100644 --- a/rvc/lib/algorithm/generators/refinegan.py +++ b/rvc/lib/algorithm/generators/refinegan.py @@ -312,7 +312,7 @@ def __init__( start_channels: int = 16, gin_channels: int = 256, checkpointing: bool = False, - upsample_initial_channel = 512 + upsample_initial_channel=512, ): super().__init__() @@ -350,14 +350,14 @@ def __init__( padding = 0 if stride == 1 else (kernel - stride) // 2 # f0 input gets upscaled to full segment size, then downscaled back to match each upscale step - + self.downsample_blocks.append( nn.Conv1d( in_channels=1, out_channels=channels // 2 ** (i + 2), kernel_size=kernel, stride=stride, - padding = padding + padding=padding, ) ) @@ -387,12 +387,13 @@ def __init__( channels, channels, kernel_size=15, - padding=7, + padding=7, groups=channels, - bias=False) + bias=False, + ) low_pass.weight.data.fill_(1.0 / 15) - + self.filters.append(low_pass) self.upsample_conv_blocks.append( @@ -416,7 +417,6 @@ def __init__( padding=3, ) ) - def forward(self, mel: torch.Tensor, f0: torch.Tensor, g: torch.Tensor = None): @@ -454,7 +454,7 @@ def forward(self, mel: torch.Tensor, f0: torch.Tensor, g: torch.Tensor = None): x = flt(x) x = torch.cat([x, down(har_source)], dim=1) x = res(x) - + # in-place call x = F.leaky_relu_(x, self.leaky_relu_slope) x = self.conv_post(x)