Format code (#624)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2023-06-24 18:06:17 +08:00 committed by GitHub
parent 04d7813486
commit fad31f24f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View File

@ -63,7 +63,8 @@ class Config:
# 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

View File

@ -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])

View File

@ -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

View File

@ -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