From cd5492a14781515ca46a558648a295257583fef1 Mon Sep 17 00:00:00 2001 From: YuriHead Date: Tue, 27 Jun 2023 16:13:16 +0800 Subject: [PATCH] Delete unused variables --- .gitignore | 2 ++ .ruff.toml | 4 ---- .vscode/extensions.json | 6 ------ diffusion/data_loaders.py | 1 - diffusion/diffusion_onnx.py | 3 --- diffusion/dpm_solver_pytorch.py | 1 - diffusion/unit2mel.py | 1 - onnx_export_speaker_mix.py | 1 - vdecoder/hifigan/models.py | 2 -- vdecoder/hifiganwithsnake/models.py | 2 -- 10 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 .ruff.toml delete mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index bb95e1f..a26a9e6 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index ba961ac..0000000 --- a/.ruff.toml +++ /dev/null @@ -1,4 +0,0 @@ -select = ["E", "F", "I"] - -# Never enforce `E501` (line length violations). -ignore = ["E501"] diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 37c0a82..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "recommendations": [ - "charliermarsh.ruff", - "ms-python.python" - ] -} \ No newline at end of file diff --git a/diffusion/data_loaders.py b/diffusion/data_loaders.py index b4ed93b..9f00b9a 100644 --- a/diffusion/data_loaders.py +++ b/diffusion/data_loaders.py @@ -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) diff --git a/diffusion/diffusion_onnx.py b/diffusion/diffusion_onnx.py index 6282288..f01e463 100644 --- a/diffusion/diffusion_onnx.py +++ b/diffusion/diffusion_onnx.py @@ -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) diff --git a/diffusion/dpm_solver_pytorch.py b/diffusion/dpm_solver_pytorch.py index 037da37..83ed73e 100644 --- a/diffusion/dpm_solver_pytorch.py +++ b/diffusion/dpm_solver_pytorch.py @@ -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) diff --git a/diffusion/unit2mel.py b/diffusion/unit2mel.py index b423f0c..5087f2a 100644 --- a/diffusion/unit2mel.py +++ b/diffusion/unit2mel.py @@ -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 = {} diff --git a/onnx_export_speaker_mix.py b/onnx_export_speaker_mix.py index aa3c9f0..42c11ad 100644 --- a/onnx_export_speaker_mix.py +++ b/onnx_export_speaker_mix.py @@ -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) diff --git a/vdecoder/hifigan/models.py b/vdecoder/hifigan/models.py index 99d533e..10eca45 100644 --- a/vdecoder/hifigan/models.py +++ b/vdecoder/hifigan/models.py @@ -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)) diff --git a/vdecoder/hifiganwithsnake/models.py b/vdecoder/hifiganwithsnake/models.py index 04277bd..ab9bcd1 100644 --- a/vdecoder/hifiganwithsnake/models.py +++ b/vdecoder/hifiganwithsnake/models.py @@ -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))