Delete unused variables

This commit is contained in:
YuriHead 2023-06-27 16:13:16 +08:00
parent d17df17044
commit cd5492a147
10 changed files with 2 additions and 21 deletions

2
.gitignore vendored
View File

@ -156,6 +156,7 @@ filelists/test.txt
filelists/train.txt
filelists/val.txt
.idea/
.vscode/
.idea/modules.xml
.idea/so-vits-svc.iml
.idea/vcs.xml
@ -168,3 +169,4 @@ pretrain/vec-256-layer-9.onnx
pretrain/vec-256-layer-12.onnx
pretrain/vec-768-layer-9.onnx
.vscode/launch.json
.ruff.toml

View File

@ -1,4 +0,0 @@
select = ["E", "F", "I"]
# Never enforce `E501` (line length violations).
ignore = ["E501"]

View File

@ -1,6 +0,0 @@
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.python"
]
}

View File

@ -131,7 +131,6 @@ class AudioDataset(Dataset):
with open(filelists,"r") as f:
self.paths = f.read().splitlines()
for name_ext in tqdm(self.paths, total=len(self.paths)):
os.path.splitext(name_ext)[0]
path_audio = name_ext
duration = librosa.get_duration(filename = path_audio, sr = self.sample_rate)

View File

@ -581,9 +581,6 @@ class GaussianDiffusion(nn.Module):
plms_noise_stage = torch.tensor(0, dtype=torch.long, device=device)
noise_list = torch.zeros((0, 1, 1, self.mel_bins, n_frames), device=device)
ot = step_range[0]
torch.full((1,), ot, device=device, dtype=torch.long)
for t in step_range:
t_1 = torch.full((1,), t, device=device, dtype=torch.long)
noise_pred = self.denoise_fn(x, t_1, cond)

View File

@ -557,7 +557,6 @@ class DPM_Solver:
x_t: A pytorch tensor. The approximated solution at time `t`.
"""
ns = self.noise_schedule
x.dim()
lambda_s, lambda_t = ns.marginal_lambda(s), ns.marginal_lambda(t)
h = lambda_t - lambda_s
log_alpha_s, log_alpha_t = ns.marginal_log_mean_coeff(s), ns.marginal_log_mean_coeff(t)

View File

@ -121,7 +121,6 @@ class Unit2Mel(nn.Module):
hubert_hidden_size = self.input_channel
n_frames = 10
hubert = torch.randn((1, n_frames, hubert_hidden_size))
torch.arange(end=n_frames).unsqueeze(0).long()
f0 = torch.randn((1, n_frames))
volume = torch.randn((1, n_frames))
spks = {}

View File

@ -130,7 +130,6 @@ def main():
"Characters": spklist
}
json.dumps(MoeVSConf)
with open(f"checkpoints/{path}.json", 'w') as MoeVsConfFile:
json.dump(MoeVSConf, MoeVsConfFile, indent = 4)

View File

@ -201,8 +201,6 @@ class SineGen(torch.nn.Module):
output uv: tensor(batchsize=1, length, 1)
"""
with torch.no_grad():
torch.zeros(f0.shape[0], f0.shape[1], self.dim,
device=f0.device)
# fundamental component
fn = torch.multiply(f0, torch.FloatTensor([[range(1, self.harmonic_num + 2)]]).to(f0.device))

View File

@ -214,8 +214,6 @@ class SineGen(torch.nn.Module):
output uv: tensor(batchsize=1, length, 1)
"""
with torch.no_grad():
torch.zeros(f0.shape[0], f0.shape[1], self.dim,
device=f0.device)
# fundamental component
fn = torch.multiply(f0, torch.FloatTensor([[range(1, self.harmonic_num + 2)]]).to(f0.device))