Skip to content

Commit

Permalink
chore(format): run black on main
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 1, 2025
1 parent 6f0b733 commit dc74d11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions rvc/lib/algorithm/generators/refinegan.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from rvc.lib.algorithm.commons import get_padding


def kaiser_sinc_filter1d(cutoff, half_width, kernel_size):
even = kernel_size % 2 == 0
half_size = kernel_size // 2
Expand Down Expand Up @@ -57,6 +58,7 @@ def forward(self, x):
x = x[..., self.pad_left : -self.pad_right] # noqa
return x


class ResBlock(torch.nn.Module):
"""
Residual block with multiple dilated convolutions.
Expand Down Expand Up @@ -164,7 +166,7 @@ def __init__(
*,
channels: int,
leaky_relu_slope: float = 0.2,
use_noise_gen = True,
use_noise_gen=True,
):
super().__init__()

Expand All @@ -179,7 +181,8 @@ def forward(self, x: torch.Tensor):
return self.activation(x + gaussian)
else:
return self.activation(x)



class ParallelResBlock(torch.nn.Module):
"""
Parallel residual block that applies multiple residual blocks with different kernel sizes in parallel.
Expand Down Expand Up @@ -226,7 +229,7 @@ def __init__(
leaky_relu_slope=leaky_relu_slope,
),
# disabled a second noise inductor as one is enough
AdaIN(channels=out_channels, use_noise_gen = False),
AdaIN(channels=out_channels, use_noise_gen=False),
)
for kernel_size in kernel_sizes
]
Expand Down Expand Up @@ -463,7 +466,9 @@ def __init__(
new_channels = channels // 2

self.upsample_blocks.append(
UpSample1d(rate) # upsampler borrowed from BigVGAN, filters out mirrored harmonics
UpSample1d(
rate
) # upsampler borrowed from BigVGAN, filters out mirrored harmonics
)

self.upsample_conv_blocks.append(
Expand Down
6 changes: 3 additions & 3 deletions rvc/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
cleanup = strtobool(sys.argv[15])
vocoder = sys.argv[16]
checkpointing = strtobool(sys.argv[17])
randomized=True
optimizer="RAdam" # "AdamW"
randomized = True
optimizer = "RAdam" # "AdamW"

current_dir = os.getcwd()
experiment_dir = os.path.join(current_dir, "logs", model_name)
Expand Down Expand Up @@ -400,7 +400,7 @@ def run(
optimizer = torch.optim.AdamW
elif optimizer == "RAdam":
optimizer = torch.optim.RAdam

optim_g = optimizer(
net_g.parameters(),
config.train.learning_rate,
Expand Down

0 comments on commit dc74d11

Please sign in to comment.