Skip to content

Commit

Permalink
resblock as an int
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisewf committed Dec 3, 2024
1 parent 2b87871 commit e8482f0
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion rvc/configs/v1/32000.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0,
"resblock": "1",
"resblock": 1,
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [10,4,2,2,2],
Expand Down
2 changes: 1 addition & 1 deletion rvc/configs/v1/40000.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0,
"resblock": "1",
"resblock": 1,
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [10,10,2,2],
Expand Down
2 changes: 1 addition & 1 deletion rvc/configs/v1/48000.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0,
"resblock": "1",
"resblock": 1,
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [10,6,2,2,2],
Expand Down
2 changes: 1 addition & 1 deletion rvc/configs/v2/32000.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0,
"resblock": "1",
"resblock": 1,
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [10,8,2,2],
Expand Down
2 changes: 1 addition & 1 deletion rvc/configs/v2/40000.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0,
"resblock": "1",
"resblock": 1,
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [10,10,2,2],
Expand Down
2 changes: 1 addition & 1 deletion rvc/configs/v2/48000.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"n_layers": 6,
"kernel_size": 3,
"p_dropout": 0,
"resblock": "1",
"resblock": 1,
"resblock_kernel_sizes": [3,7,11],
"resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]],
"upsample_rates": [12,10,2,2],
Expand Down
5 changes: 2 additions & 3 deletions rvc/lib/algorithm/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from torch.nn.utils.parametrizations import weight_norm
from typing import Optional

from rvc.lib.algorithm.residuals import LRELU_SLOPE, ResBlock1, ResBlock2
from rvc.lib.algorithm.residuals import LRELU_SLOPE, ResBlock
from rvc.lib.algorithm.commons import init_weights


Expand Down Expand Up @@ -39,7 +39,6 @@ def __init__(
self.conv_pre = torch.nn.Conv1d(
initial_channel, upsample_initial_channel, 7, 1, padding=3
)
resblock = ResBlock1 if resblock == "1" else ResBlock2

self.ups = torch.nn.ModuleList()
self.resblocks = torch.nn.ModuleList()
Expand All @@ -60,7 +59,7 @@ def __init__(
for j, (k, d) in enumerate(
zip(resblock_kernel_sizes, resblock_dilation_sizes)
):
self.resblocks.append(resblock(ch, k, d))
self.resblocks.append(ResBlock(ch, k, d))

self.conv_post = torch.nn.Conv1d(ch, 1, 7, 1, padding=3, bias=False)
self.ups.apply(init_weights)
Expand Down
9 changes: 2 additions & 7 deletions rvc/lib/algorithm/residuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,9 @@ def remove_weight_norm(self):
remove_weight_norm(conv)


class ResBlock1(ResBlockBase):
class ResBlock(ResBlockBase):
def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)):
super(ResBlock1, self).__init__(channels, kernel_size, dilation)


class ResBlock2(ResBlockBase):
def __init__(self, channels, kernel_size=3, dilation=(1, 3)):
super(ResBlock2, self).__init__(channels, kernel_size, dilation)
super(ResBlock, self).__init__(channels, kernel_size, dilation)


class Flip(torch.nn.Module):
Expand Down

0 comments on commit e8482f0

Please sign in to comment.