mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2024-12-29 02:55:05 +08:00
Format code (#624)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
04d7813486
commit
fad31f24f5
@ -58,12 +58,13 @@ class Config:
|
||||
cmd_opts.noparallel,
|
||||
cmd_opts.noautoopen,
|
||||
)
|
||||
|
||||
|
||||
# has_mps is only available in nightly pytorch (for now) and MasOS 12.3+.
|
||||
# check `getattr` and try it for compatibility
|
||||
@staticmethod
|
||||
def has_mps() -> bool:
|
||||
if not torch.backends.mps.is_available(): return False
|
||||
if not torch.backends.mps.is_available():
|
||||
return False
|
||||
try:
|
||||
torch.zeros(1).to(torch.device("mps"))
|
||||
return True
|
||||
|
@ -1,6 +1,6 @@
|
||||
import os, sys, traceback
|
||||
|
||||
os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1'
|
||||
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
||||
|
||||
# device=sys.argv[1]
|
||||
n_part = int(sys.argv[2])
|
||||
|
@ -43,7 +43,9 @@ logging.getLogger("numba").setLevel(logging.WARNING)
|
||||
|
||||
tmp = os.path.join(now_dir, "TEMP")
|
||||
shutil.rmtree(tmp, ignore_errors=True)
|
||||
shutil.rmtree("%s/runtime/Lib/site-packages/lib.infer_pack" % (now_dir), ignore_errors=True)
|
||||
shutil.rmtree(
|
||||
"%s/runtime/Lib/site-packages/lib.infer_pack" % (now_dir), ignore_errors=True
|
||||
)
|
||||
shutil.rmtree("%s/runtime/Lib/site-packages/uvr5_pack" % (now_dir), ignore_errors=True)
|
||||
os.makedirs(tmp, exist_ok=True)
|
||||
os.makedirs(os.path.join(now_dir, "logs"), exist_ok=True)
|
||||
@ -328,6 +330,7 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
|
||||
)
|
||||
if model_name == "onnx_dereverb_By_FoxJoy":
|
||||
from MDXNet import MDXNetDereverb
|
||||
|
||||
pre_fun = MDXNetDereverb(15)
|
||||
else:
|
||||
func = _audio_pre_ if "DeEcho" not in model_name else _audio_pre_new
|
||||
|
@ -39,7 +39,9 @@ def get_f0_predictor(f0_predictor, hop_length, sampling_rate, **kargs):
|
||||
hop_length=hop_length, sampling_rate=sampling_rate
|
||||
)
|
||||
elif f0_predictor == "harvest":
|
||||
from lib.infer_pack.modules.F0Predictor.HarvestF0Predictor import HarvestF0Predictor
|
||||
from lib.infer_pack.modules.F0Predictor.HarvestF0Predictor import (
|
||||
HarvestF0Predictor,
|
||||
)
|
||||
|
||||
f0_predictor_object = HarvestF0Predictor(
|
||||
hop_length=hop_length, sampling_rate=sampling_rate
|
||||
|
Loading…
Reference in New Issue
Block a user