1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

chore(format): run black on dev (#11)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-06-08 00:46:57 +09:00
committed by GitHub
parent b91dcf2261
commit 26dc9ba98d
7 changed files with 11 additions and 13 deletions

View File

@@ -355,9 +355,7 @@ class GeneratorNSF(torch.nn.Module):
self.num_upsamples = len(upsample_rates)
self.f0_upsamp = torch.nn.Upsample(scale_factor=math.prod(upsample_rates))
self.m_source = SourceModuleHnNSF(
sampling_rate=sr, harmonic_num=0
)
self.m_source = SourceModuleHnNSF(sampling_rate=sr, harmonic_num=0)
self.noise_convs = nn.ModuleList()
self.conv_pre = Conv1d(
initial_channel, upsample_initial_channel, 7, 1, padding=3

View File

@@ -6,6 +6,7 @@ from torch.nn import functional as F
from .utils import activate_add_tanh_sigmoid_multiply
class LayerNorm(nn.Module):
def __init__(self, channels: int, eps: float = 1e-5):
super(LayerNorm, self).__init__()
@@ -20,6 +21,7 @@ class LayerNorm(nn.Module):
x = F.layer_norm(x, (self.channels,), self.gamma, self.beta, self.eps)
return x.transpose(1, -1)
class WN(torch.nn.Module):
def __init__(
self,

View File

@@ -10,9 +10,7 @@ class DioF0Predictor(F0Predictor):
def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
super().__init__(hop_length, f0_min, f0_max, sampling_rate)
def compute_f0(
self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None
):
def compute_f0(self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None):
if p_len is None:
p_len = wav.shape[0] // self.hop_length
f0, t = pyworld.dio(

View File

@@ -10,9 +10,7 @@ class HarvestF0Predictor(F0Predictor):
def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
super().__init__(hop_length, f0_min, f0_max, sampling_rate)
def compute_f0(
self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None
):
def compute_f0(self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None):
if p_len is None:
p_len = wav.shape[0] // self.hop_length
f0, t = pyworld.harvest(

View File

@@ -10,9 +10,7 @@ class PMF0Predictor(F0Predictor):
def __init__(self, hop_length=512, f0_min=50, f0_max=1100, sampling_rate=44100):
super().__init__(hop_length, f0_min, f0_max, sampling_rate)
def compute_f0(
self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None
):
def compute_f0(self, wav: np.ndarray[Any, np.dtype], p_len: Optional[int] = None):
x = wav
if p_len is None:
p_len = x.shape[0] // self.hop_length

View File

@@ -14,6 +14,7 @@ from .utils import (
LRELU_SLOPE = 0.1
class ResBlock1(torch.nn.Module):
def __init__(
self,
@@ -111,6 +112,7 @@ class ResBlock2(torch.nn.Module):
Actually this module is not used currently
because all configs specified "resblock": "1"
"""
def __init__(
self,
channels: int,
@@ -255,6 +257,7 @@ class ResidualCouplingLayer(nn.Module):
torch.nn.utils.remove_weight_norm(self.enc)
return self
class ResidualCouplingBlock(nn.Module):
class Flip(nn.Module):
"""
@@ -262,6 +265,7 @@ class ResidualCouplingBlock(nn.Module):
can't take variable number of arguments or
use keyword-only arguments with defaults
"""
def forward(
self,
x: torch.Tensor,