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 (#13)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-06-09 15:37:32 +09:00
committed by GitHub
parent 5790ea7a73
commit 95f627d991
6 changed files with 16 additions and 8 deletions

View File

@@ -309,7 +309,7 @@ class SynthesizerTrnMs256NSFsid_nono(nn.Module):
upsample_kernel_sizes: List[int], upsample_kernel_sizes: List[int],
spk_embed_dim: int, spk_embed_dim: int,
gin_channels: int, gin_channels: int,
sr = None, sr=None,
): ):
super(SynthesizerTrnMs256NSFsid_nono, self).__init__() super(SynthesizerTrnMs256NSFsid_nono, self).__init__()
self.spec_channels = spec_channels self.spec_channels = spec_channels
@@ -464,7 +464,7 @@ class SynthesizerTrnMs768NSFsid_nono(SynthesizerTrnMs256NSFsid_nono):
upsample_kernel_sizes: List[int], upsample_kernel_sizes: List[int],
spk_embed_dim: int, spk_embed_dim: int,
gin_channels: int, gin_channels: int,
sr = None, sr=None,
): ):
super(SynthesizerTrnMs768NSFsid_nono, self).__init__( super(SynthesizerTrnMs768NSFsid_nono, self).__init__(
spec_channels, spec_channels,

View File

@@ -256,7 +256,7 @@ def load_filepaths_and_text(filename, split="|"):
except UnicodeDecodeError: except UnicodeDecodeError:
with open(filename) as f: with open(filename) as f:
filepaths_and_text = [line.strip().split(split) for line in f] filepaths_and_text = [line.strip().split(split) for line in f]
return filepaths_and_text return filepaths_and_text

View File

@@ -229,6 +229,7 @@ class FFN(nn.Module):
""" """
Feed-Forward Network Feed-Forward Network
""" """
def __init__( def __init__(
self, self,
in_channels: int, in_channels: int,

View File

@@ -161,6 +161,7 @@ class TextEncoder(nn.Module):
m, logs = torch.split(stats, self.out_channels, dim=1) m, logs = torch.split(stats, self.out_channels, dim=1)
return m, logs, x_mask return m, logs, x_mask
class PosteriorEncoder(nn.Module): class PosteriorEncoder(nn.Module):
def __init__( def __init__(
self, self,

View File

@@ -9,6 +9,7 @@ from torch.nn.utils import remove_weight_norm, weight_norm
from .residuals import ResBlock1, ResBlock2, LRELU_SLOPE from .residuals import ResBlock1, ResBlock2, LRELU_SLOPE
from .utils import call_weight_data_normal_if_Conv from .utils import call_weight_data_normal_if_Conv
class Generator(torch.nn.Module): class Generator(torch.nn.Module):
def __init__( def __init__(
self, self,
@@ -156,11 +157,15 @@ class SineGenerator(torch.nn.Module):
self.dim = harmonic_num + 1 self.dim = harmonic_num + 1
self.sampling_rate = samp_rate self.sampling_rate = samp_rate
self.voiced_threshold = voiced_threshold self.voiced_threshold = voiced_threshold
def __call__(self, f0: torch.Tensor, upp: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: def __call__(
self, f0: torch.Tensor, upp: int
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
return super().__call__(f0, upp) return super().__call__(f0, upp)
def forward(self, f0: torch.Tensor, upp: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: def forward(
self, f0: torch.Tensor, upp: int
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
"""sine_tensor, uv = forward(f0) """sine_tensor, uv = forward(f0)
input F0: tensor(batchsize=1, length, dim=1) input F0: tensor(batchsize=1, length, dim=1)
f0 for unvoiced steps should be 0 f0 for unvoiced steps should be 0
@@ -190,7 +195,7 @@ class SineGenerator(torch.nn.Module):
tmp_over_one *= upp tmp_over_one *= upp
tmp_over_one: torch.Tensor = F.interpolate( tmp_over_one: torch.Tensor = F.interpolate(
tmp_over_one.transpose(2, 1), tmp_over_one.transpose(2, 1),
scale_factor = float(upp), scale_factor=float(upp),
mode="linear", mode="linear",
align_corners=True, align_corners=True,
).transpose(2, 1) ).transpose(2, 1)

View File

@@ -57,7 +57,8 @@ class SourceModuleHnNSF(torch.nn.Module):
sine_wavs, _, _ = self.l_sin_gen(x, upp) sine_wavs, _, _ = self.l_sin_gen(x, upp)
sine_wavs = sine_wavs.to(dtype=self.l_linear.weight.dtype) sine_wavs = sine_wavs.to(dtype=self.l_linear.weight.dtype)
sine_merge: torch.Tensor = self.l_tanh(self.l_linear(sine_wavs)) sine_merge: torch.Tensor = self.l_tanh(self.l_linear(sine_wavs))
return sine_merge #, None, None # noise, uv return sine_merge # , None, None # noise, uv
class NSFGenerator(torch.nn.Module): class NSFGenerator(torch.nn.Module):
def __init__( def __init__(