Skip to content

Commit

Permalink
Merge pull request #962 from IAHispano/formatter/main
Browse files Browse the repository at this point in the history
chore(format): run black on main
  • Loading branch information
blaisewf authored Jan 25, 2025
2 parents 9cfa0ae + d573455 commit 36fd2ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rvc/lib/algorithm/generators/refinegan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()

Expand Down Expand Up @@ -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,
)
)

Expand Down Expand Up @@ -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(
Expand All @@ -416,7 +417,6 @@ def __init__(
padding=3,
)
)


def forward(self, mel: torch.Tensor, f0: torch.Tensor, g: torch.Tensor = None):

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 36fd2ed

Please sign in to comment.