Spaces:
Sleeping
Sleeping
Commit ·
b18dcd9
1
Parent(s): d8651ae
Fix IndentationError: properly rewrite rvc_logic files and cleanup binaries
Browse files- rvc_logic/core_train/common.py +0 -1
- rvc_logic/core_train/extract.py +0 -2
- rvc_logic/core_train/prepare.py +0 -2
- rvc_logic/core_train/train.py +0 -1
- rvc_logic/core_train/typing_extra.py +0 -1
- rvc_logic/rvc/configs/config.py +0 -1
- rvc_logic/rvc/infer/infer.py +0 -1
- rvc_logic/rvc/infer/pipeline.py +0 -1
- rvc_logic/rvc/infer/typing_extra.py +0 -1
- rvc_logic/rvc/lib/algorithm/attentions.py +0 -1
- rvc_logic/rvc/lib/algorithm/discriminators.py +0 -1
- rvc_logic/rvc/lib/algorithm/encoders.py +0 -1
- rvc_logic/rvc/lib/algorithm/generators/hifigan.py +0 -1
- rvc_logic/rvc/lib/algorithm/generators/hifigan_nsf.py +0 -1
- rvc_logic/rvc/lib/algorithm/generators/refinegan.py +0 -1
- rvc_logic/rvc/lib/algorithm/modules.py +0 -1
- rvc_logic/rvc/lib/algorithm/residuals.py +0 -1
- rvc_logic/rvc/lib/algorithm/synthesizers.py +0 -1
- rvc_logic/rvc/lib/predictors/F0Extractor.py +0 -1
- rvc_logic/rvc/lib/predictors/f0.py +0 -1
- rvc_logic/rvc/lib/tools/model_download.py +0 -1
- rvc_logic/rvc/lib/tools/prerequisites_download.py +0 -1
- rvc_logic/rvc/lib/tools/pretrained_selector.py +0 -1
- rvc_logic/rvc/lib/utils.py +0 -1
- rvc_logic/rvc/train/data_utils.py +0 -1
- rvc_logic/rvc/train/extract/extract.py +0 -1
- rvc_logic/rvc/train/extract/preparing_files.py +0 -1
- rvc_logic/rvc/train/preprocess/preprocess.py +0 -2
- rvc_logic/rvc/train/train.py +0 -1
rvc_logic/core_train/common.py
CHANGED
|
@@ -102,4 +102,3 @@ def validate_devices(
|
|
| 102 |
return "cuda", set(validated_devices)
|
| 103 |
case DeviceType.CPU:
|
| 104 |
return "cpu", None
|
| 105 |
-
None
|
|
|
|
| 102 |
return "cuda", set(validated_devices)
|
| 103 |
case DeviceType.CPU:
|
| 104 |
return "cpu", None
|
|
|
rvc_logic/core_train/extract.py
CHANGED
|
@@ -142,5 +142,3 @@ def extract_features(
|
|
| 142 |
f0_method,
|
| 143 |
embedder_model_id,
|
| 144 |
)
|
| 145 |
-
model_id,
|
| 146 |
-
)
|
|
|
|
| 142 |
f0_method,
|
| 143 |
embedder_model_id,
|
| 144 |
)
|
|
|
|
|
|
rvc_logic/core_train/prepare.py
CHANGED
|
@@ -201,5 +201,3 @@ def preprocess_dataset(
|
|
| 201 |
overlap_len,
|
| 202 |
normalization_mode,
|
| 203 |
)
|
| 204 |
-
ion_mode,
|
| 205 |
-
)
|
|
|
|
| 201 |
overlap_len,
|
| 202 |
normalization_mode,
|
| 203 |
)
|
|
|
|
|
|
rvc_logic/core_train/train.py
CHANGED
|
@@ -366,4 +366,3 @@ def stop_training(model_name: str) -> None:
|
|
| 366 |
json_dump(updated_training_info_dict, training_info_path)
|
| 367 |
except Exception as e: # noqa: BLE001
|
| 368 |
logger.error("Error stopping training: %s", e) # noqa: TRY400
|
| 369 |
-
s", e) # noqa: TRY400
|
|
|
|
| 366 |
json_dump(updated_training_info_dict, training_info_path)
|
| 367 |
except Exception as e: # noqa: BLE001
|
| 368 |
logger.error("Error stopping training: %s", e) # noqa: TRY400
|
|
|
rvc_logic/core_train/typing_extra.py
CHANGED
|
@@ -40,4 +40,3 @@ class TrainingInfo(BaseModel):
|
|
| 40 |
process_pids: list[int] = []
|
| 41 |
# TODO add more attributes later
|
| 42 |
model_config = ConfigDict(extra="allow")
|
| 43 |
-
ow")
|
|
|
|
| 40 |
process_pids: list[int] = []
|
| 41 |
# TODO add more attributes later
|
| 42 |
model_config = ConfigDict(extra="allow")
|
|
|
rvc_logic/rvc/configs/config.py
CHANGED
|
@@ -102,4 +102,3 @@ def get_number_of_gpus():
|
|
| 102 |
num_gpus = torch.cuda.device_count()
|
| 103 |
return "-".join(map(str, range(num_gpus)))
|
| 104 |
return "-"
|
| 105 |
-
"
|
|
|
|
| 102 |
num_gpus = torch.cuda.device_count()
|
| 103 |
return "-".join(map(str, range(num_gpus)))
|
| 104 |
return "-"
|
|
|
rvc_logic/rvc/infer/infer.py
CHANGED
|
@@ -525,4 +525,3 @@ class VoiceConverter:
|
|
| 525 |
if self.cpt is not None:
|
| 526 |
self.vc = VC(self.tgt_sr, self.config)
|
| 527 |
self.n_spk = self.cpt["config"][-3]
|
| 528 |
-
f.cpt["config"][-3]
|
|
|
|
| 525 |
if self.cpt is not None:
|
| 526 |
self.vc = VC(self.tgt_sr, self.config)
|
| 527 |
self.n_spk = self.cpt["config"][-3]
|
|
|
rvc_logic/rvc/infer/pipeline.py
CHANGED
|
@@ -578,4 +578,3 @@ class Pipeline:
|
|
| 578 |
if torch.cuda.is_available():
|
| 579 |
torch.cuda.empty_cache()
|
| 580 |
return audio_opt
|
| 581 |
-
t
|
|
|
|
| 578 |
if torch.cuda.is_available():
|
| 579 |
torch.cuda.empty_cache()
|
| 580 |
return audio_opt
|
|
|
rvc_logic/rvc/infer/typing_extra.py
CHANGED
|
@@ -55,4 +55,3 @@ class ConvertAudioKwArgs(TypedDict, total=False):
|
|
| 55 |
delay_seconds: float
|
| 56 |
delay_feedback: float
|
| 57 |
delay_mix: float
|
| 58 |
-
t
|
|
|
|
| 55 |
delay_seconds: float
|
| 56 |
delay_feedback: float
|
| 57 |
delay_mix: float
|
|
|
rvc_logic/rvc/lib/algorithm/attentions.py
CHANGED
|
@@ -255,4 +255,3 @@ class FFN(torch.nn.Module):
|
|
| 255 |
x,
|
| 256 |
convert_pad_shape([[0, 0], [0, 0], [pad, pad]]),
|
| 257 |
)
|
| 258 |
-
)
|
|
|
|
| 255 |
x,
|
| 256 |
convert_pad_shape([[0, 0], [0, 0], [pad, pad]]),
|
| 257 |
)
|
|
|
rvc_logic/rvc/lib/algorithm/discriminators.py
CHANGED
|
@@ -264,4 +264,3 @@ class DiscriminatorR(torch.nn.Module):
|
|
| 264 |
mag = torch.norm(torch.view_as_real(x), p=2, dim=-1) # [B, F, TT]
|
| 265 |
|
| 266 |
return mag
|
| 267 |
-
mag
|
|
|
|
| 264 |
mag = torch.norm(torch.view_as_real(x), p=2, dim=-1) # [B, F, TT]
|
| 265 |
|
| 266 |
return mag
|
|
|
rvc_logic/rvc/lib/algorithm/encoders.py
CHANGED
|
@@ -225,4 +225,3 @@ class PosteriorEncoder(torch.nn.Module):
|
|
| 225 |
):
|
| 226 |
torch.nn.utils.remove_weight_norm(self.enc)
|
| 227 |
return self
|
| 228 |
-
eturn self
|
|
|
|
| 225 |
):
|
| 226 |
torch.nn.utils.remove_weight_norm(self.enc)
|
| 227 |
return self
|
|
|
rvc_logic/rvc/lib/algorithm/generators/hifigan.py
CHANGED
|
@@ -246,4 +246,3 @@ class SineGenerator(torch.nn.Module):
|
|
| 246 |
sine_waveforms = sine_waves * voiced_mask + noise
|
| 247 |
|
| 248 |
return sine_waveforms, voiced_mask, noise
|
| 249 |
-
oise
|
|
|
|
| 246 |
sine_waveforms = sine_waves * voiced_mask + noise
|
| 247 |
|
| 248 |
return sine_waveforms, voiced_mask, noise
|
|
|
rvc_logic/rvc/lib/algorithm/generators/hifigan_nsf.py
CHANGED
|
@@ -255,4 +255,3 @@ class HiFiGANNSFGenerator(torch.nn.Module):
|
|
| 255 |
):
|
| 256 |
remove_weight_norm(l)
|
| 257 |
return self
|
| 258 |
-
rn self
|
|
|
|
| 255 |
):
|
| 256 |
remove_weight_norm(l)
|
| 257 |
return self
|
|
|
rvc_logic/rvc/lib/algorithm/generators/refinegan.py
CHANGED
|
@@ -459,4 +459,3 @@ class RefineGANGenerator(nn.Module):
|
|
| 459 |
|
| 460 |
for block in self.upsample_conv_blocks:
|
| 461 |
block.remove_weight_norm()
|
| 462 |
-
)
|
|
|
|
| 459 |
|
| 460 |
for block in self.upsample_conv_blocks:
|
| 461 |
block.remove_weight_norm()
|
|
|
rvc_logic/rvc/lib/algorithm/modules.py
CHANGED
|
@@ -117,4 +117,3 @@ class WaveNet(torch.nn.Module):
|
|
| 117 |
torch.nn.utils.remove_weight_norm(layer)
|
| 118 |
for layer in self.res_skip_layers:
|
| 119 |
torch.nn.utils.remove_weight_norm(layer)
|
| 120 |
-
)
|
|
|
|
| 117 |
torch.nn.utils.remove_weight_norm(layer)
|
| 118 |
for layer in self.res_skip_layers:
|
| 119 |
torch.nn.utils.remove_weight_norm(layer)
|
|
|
rvc_logic/rvc/lib/algorithm/residuals.py
CHANGED
|
@@ -268,4 +268,3 @@ class ResidualCouplingLayer(torch.nn.Module):
|
|
| 268 |
|
| 269 |
def remove_weight_norm(self):
|
| 270 |
self.enc.remove_weight_norm()
|
| 271 |
-
rm()
|
|
|
|
| 268 |
|
| 269 |
def remove_weight_norm(self):
|
| 270 |
self.enc.remove_weight_norm()
|
|
|
rvc_logic/rvc/lib/algorithm/synthesizers.py
CHANGED
|
@@ -248,4 +248,3 @@ class Synthesizer(torch.nn.Module):
|
|
| 248 |
)
|
| 249 |
|
| 250 |
return o, x_mask, (z, z_p, m_p, logs_p)
|
| 251 |
-
, z_p, m_p, logs_p)
|
|
|
|
| 248 |
)
|
| 249 |
|
| 250 |
return o, x_mask, (z, z_p, m_p, logs_p)
|
|
|
rvc_logic/rvc/lib/predictors/F0Extractor.py
CHANGED
|
@@ -108,4 +108,3 @@ class F0Extractor:
|
|
| 108 |
F_temp[F_temp == 0] = np.nan
|
| 109 |
F_cents = 1200 * np.log2(F_temp / F_ref)
|
| 110 |
return F_cents
|
| 111 |
-
F_cents
|
|
|
|
| 108 |
F_temp[F_temp == 0] = np.nan
|
| 109 |
F_cents = 1200 * np.log2(F_temp / F_ref)
|
| 110 |
return F_cents
|
|
|
rvc_logic/rvc/lib/predictors/f0.py
CHANGED
|
@@ -89,4 +89,3 @@ class FCPE:
|
|
| 89 |
)
|
| 90 |
|
| 91 |
return f0
|
| 92 |
-
n f0
|
|
|
|
| 89 |
)
|
| 90 |
|
| 91 |
return f0
|
|
|
rvc_logic/rvc/lib/tools/model_download.py
CHANGED
|
@@ -235,4 +235,3 @@ def clean_extracted_files(extract_folder_path, model_name):
|
|
| 235 |
destination_path = os.path.join(extract_folder_path, new_file_name)
|
| 236 |
if not pathlib.Path(destination_path).exists():
|
| 237 |
pathlib.Path(source_path).rename(destination_path)
|
| 238 |
-
ath)
|
|
|
|
| 235 |
destination_path = os.path.join(extract_folder_path, new_file_name)
|
| 236 |
if not pathlib.Path(destination_path).exists():
|
| 237 |
pathlib.Path(source_path).rename(destination_path)
|
|
|
rvc_logic/rvc/lib/tools/prerequisites_download.py
CHANGED
|
@@ -195,4 +195,3 @@ def prequisites_download_pipeline(
|
|
| 195 |
if pretraineds_hifigan:
|
| 196 |
download_mapping_files(pretraineds_hifigan_list, global_bar)
|
| 197 |
download_mapping_files(pretraineds_refinegan_list, global_bar)
|
| 198 |
-
)
|
|
|
|
| 195 |
if pretraineds_hifigan:
|
| 196 |
download_mapping_files(pretraineds_hifigan_list, global_bar)
|
| 197 |
download_mapping_files(pretraineds_refinegan_list, global_bar)
|
|
|
rvc_logic/rvc/lib/tools/pretrained_selector.py
CHANGED
|
@@ -13,4 +13,3 @@ def pretrained_selector(vocoder: str, sample_rate: int) -> tuple[str, str]:
|
|
| 13 |
if pathlib.Path(path_g).exists() and pathlib.Path(path_d).exists():
|
| 14 |
return path_g, path_d
|
| 15 |
return "", ""
|
| 16 |
-
"
|
|
|
|
| 13 |
if pathlib.Path(path_g).exists() and pathlib.Path(path_d).exists():
|
| 14 |
return path_g, path_d
|
| 15 |
return "", ""
|
|
|
rvc_logic/rvc/lib/utils.py
CHANGED
|
@@ -191,4 +191,3 @@ def load_embedding(embedder_model, custom_embedder=None):
|
|
| 191 |
|
| 192 |
models = HubertModelWithFinalProj.from_pretrained(model_path)
|
| 193 |
return models
|
| 194 |
-
s
|
|
|
|
| 191 |
|
| 192 |
models = HubertModelWithFinalProj.from_pretrained(model_path)
|
| 193 |
return models
|
|
|
rvc_logic/rvc/train/data_utils.py
CHANGED
|
@@ -393,4 +393,3 @@ class DistributedBucketSampler(torch.utils.data.distributed.DistributedSampler):
|
|
| 393 |
Returns the length of the sampler.
|
| 394 |
"""
|
| 395 |
return self.num_samples // self.batch_size
|
| 396 |
-
size
|
|
|
|
| 393 |
Returns the length of the sampler.
|
| 394 |
"""
|
| 395 |
return self.num_samples // self.batch_size
|
|
|
rvc_logic/rvc/train/extract/extract.py
CHANGED
|
@@ -258,4 +258,3 @@ def update_model_info(
|
|
| 258 |
data["custom_embedder_model_hash"] = custom_embedder_model_hash
|
| 259 |
with pathlib.Path(file_path).open("w") as f:
|
| 260 |
json.dump(data, f, indent=4)
|
| 261 |
-
ta, f, indent=4)
|
|
|
|
| 258 |
data["custom_embedder_model_hash"] = custom_embedder_model_hash
|
| 259 |
with pathlib.Path(file_path).open("w") as f:
|
| 260 |
json.dump(data, f, indent=4)
|
|
|
rvc_logic/rvc/train/extract/preparing_files.py
CHANGED
|
@@ -112,4 +112,3 @@ def generate_filelist(
|
|
| 112 |
|
| 113 |
with pathlib.Path(os.path.join(model_path, "filelist.txt")).open("w") as f:
|
| 114 |
f.write("\n".join(options))
|
| 115 |
-
ns))
|
|
|
|
| 112 |
|
| 113 |
with pathlib.Path(os.path.join(model_path, "filelist.txt")).open("w") as f:
|
| 114 |
f.write("\n".join(options))
|
|
|
rvc_logic/rvc/train/preprocess/preprocess.py
CHANGED
|
@@ -432,5 +432,3 @@ def preprocess_training_set(
|
|
| 432 |
elapsed_time,
|
| 433 |
format_duration(audio_length),
|
| 434 |
)
|
| 435 |
-
h),
|
| 436 |
-
)
|
|
|
|
| 432 |
elapsed_time,
|
| 433 |
format_duration(audio_length),
|
| 434 |
)
|
|
|
|
|
|
rvc_logic/rvc/train/train.py
CHANGED
|
@@ -1110,4 +1110,3 @@ def cleanup_training_processes(experiment_dir) -> None:
|
|
| 1110 |
with pathlib.Path(pid_file_path).open("w") as pid_file:
|
| 1111 |
pid_data.pop("process_pids", None)
|
| 1112 |
json.dump(pid_data, pid_file, indent=4)
|
| 1113 |
-
dump(pid_data, pid_file, indent=4)
|
|
|
|
| 1110 |
with pathlib.Path(pid_file_path).open("w") as pid_file:
|
| 1111 |
pid_data.pop("process_pids", None)
|
| 1112 |
json.dump(pid_data, pid_file, indent=4)
|
|
|