mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-01-21 14:00:06 +08:00
Format code (#1076)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
ef738704d0
commit
64ac09bf66
@ -92,7 +92,8 @@ class Config:
|
|||||||
self.gpu_name = torch.cuda.get_device_name(i_device)
|
self.gpu_name = torch.cuda.get_device_name(i_device)
|
||||||
if (
|
if (
|
||||||
("16" in self.gpu_name and "V100" not in self.gpu_name.upper())
|
("16" in self.gpu_name and "V100" not in self.gpu_name.upper())
|
||||||
or "P40" in self.gpu_name.upper()or "P10" in self.gpu_name.upper()
|
or "P40" in self.gpu_name.upper()
|
||||||
|
or "P10" in self.gpu_name.upper()
|
||||||
or "1060" in self.gpu_name
|
or "1060" in self.gpu_name
|
||||||
or "1070" in self.gpu_name
|
or "1070" in self.gpu_name
|
||||||
or "1080" in self.gpu_name
|
or "1080" in self.gpu_name
|
||||||
@ -168,7 +169,7 @@ class Config:
|
|||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if(self.device!="cpu"):
|
if self.device != "cpu":
|
||||||
import torch_directml
|
import torch_directml
|
||||||
|
|
||||||
self.device = torch_directml.device(torch_directml.default_device())
|
self.device = torch_directml.device(torch_directml.default_device())
|
||||||
|
26
infer-web.py
26
infer-web.py
@ -571,9 +571,11 @@ def if_done_multi(done, ps):
|
|||||||
break
|
break
|
||||||
done[0] = True
|
done[0] = True
|
||||||
|
|
||||||
|
|
||||||
def get_quoted_python_cmd():
|
def get_quoted_python_cmd():
|
||||||
return f'"{config.python_cmd}"'
|
return f'"{config.python_cmd}"'
|
||||||
|
|
||||||
|
|
||||||
def preprocess_dataset(trainset_dir, exp_dir, sr, n_p):
|
def preprocess_dataset(trainset_dir, exp_dir, sr, n_p):
|
||||||
sr = sr_dict[sr]
|
sr = sr_dict[sr]
|
||||||
os.makedirs("%s/logs/%s" % (now_dir, exp_dir), exist_ok=True)
|
os.makedirs("%s/logs/%s" % (now_dir, exp_dir), exist_ok=True)
|
||||||
@ -616,12 +618,16 @@ def extract_f0_feature(gpus, n_p, f0method, if_f0, exp_dir, version19, gpus_rmvp
|
|||||||
f.close()
|
f.close()
|
||||||
if if_f0:
|
if if_f0:
|
||||||
if f0method != "rmvpe_gpu":
|
if f0method != "rmvpe_gpu":
|
||||||
cmd = get_quoted_python_cmd() + ' extract_f0_print.py "%s/logs/%s" %s %s' % (
|
cmd = (
|
||||||
|
get_quoted_python_cmd()
|
||||||
|
+ ' extract_f0_print.py "%s/logs/%s" %s %s'
|
||||||
|
% (
|
||||||
now_dir,
|
now_dir,
|
||||||
exp_dir,
|
exp_dir,
|
||||||
n_p,
|
n_p,
|
||||||
f0method,
|
f0method,
|
||||||
)
|
)
|
||||||
|
)
|
||||||
print(cmd)
|
print(cmd)
|
||||||
p = Popen(
|
p = Popen(
|
||||||
cmd, shell=True, cwd=now_dir
|
cmd, shell=True, cwd=now_dir
|
||||||
@ -930,10 +936,7 @@ def click_train(
|
|||||||
if pretrained_D15 == "":
|
if pretrained_D15 == "":
|
||||||
print("no pretrained Discriminator")
|
print("no pretrained Discriminator")
|
||||||
if gpus16:
|
if gpus16:
|
||||||
cmd = (
|
cmd = get_quoted_python_cmd() + ' train_nsf_sim_cache_sid_load_pretrain.py -e "%s" -sr %s -f0 %s -bs %s -g %s -te %s -se %s %s %s -l %s -c %s -sw %s -v %s' % (
|
||||||
get_quoted_python_cmd()
|
|
||||||
+ ' train_nsf_sim_cache_sid_load_pretrain.py -e "%s" -sr %s -f0 %s -bs %s -g %s -te %s -se %s %s %s -l %s -c %s -sw %s -v %s'
|
|
||||||
% (
|
|
||||||
exp_dir1,
|
exp_dir1,
|
||||||
sr2,
|
sr2,
|
||||||
1 if if_f0_3 else 0,
|
1 if if_f0_3 else 0,
|
||||||
@ -948,7 +951,6 @@ def click_train(
|
|||||||
1 if if_save_every_weights18 == i18n("是") else 0,
|
1 if if_save_every_weights18 == i18n("是") else 0,
|
||||||
version19,
|
version19,
|
||||||
)
|
)
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
cmd = (
|
cmd = (
|
||||||
config.python_cmd
|
config.python_cmd
|
||||||
@ -1163,7 +1165,10 @@ def train1key(
|
|||||||
leng = len(gpus)
|
leng = len(gpus)
|
||||||
ps = []
|
ps = []
|
||||||
for idx, n_g in enumerate(gpus):
|
for idx, n_g in enumerate(gpus):
|
||||||
cmd = get_quoted_python_cmd() + ' extract_feature_print.py %s %s %s %s "%s" %s' % (
|
cmd = (
|
||||||
|
get_quoted_python_cmd()
|
||||||
|
+ ' extract_feature_print.py %s %s %s %s "%s" %s'
|
||||||
|
% (
|
||||||
config.device,
|
config.device,
|
||||||
leng,
|
leng,
|
||||||
idx,
|
idx,
|
||||||
@ -1171,6 +1176,7 @@ def train1key(
|
|||||||
model_log_dir,
|
model_log_dir,
|
||||||
version19,
|
version19,
|
||||||
)
|
)
|
||||||
|
)
|
||||||
yield get_info_str(cmd)
|
yield get_info_str(cmd)
|
||||||
p = Popen(
|
p = Popen(
|
||||||
cmd, shell=True, cwd=now_dir
|
cmd, shell=True, cwd=now_dir
|
||||||
@ -1242,10 +1248,7 @@ def train1key(
|
|||||||
f.write("\n".join(opt))
|
f.write("\n".join(opt))
|
||||||
yield get_info_str("write filelist done")
|
yield get_info_str("write filelist done")
|
||||||
if gpus16:
|
if gpus16:
|
||||||
cmd = (
|
cmd = get_quoted_python_cmd() + ' train_nsf_sim_cache_sid_load_pretrain.py -e "%s" -sr %s -f0 %s -bs %s -g %s -te %s -se %s %s %s -l %s -c %s -sw %s -v %s' % (
|
||||||
get_quoted_python_cmd()
|
|
||||||
+ ' train_nsf_sim_cache_sid_load_pretrain.py -e "%s" -sr %s -f0 %s -bs %s -g %s -te %s -se %s %s %s -l %s -c %s -sw %s -v %s'
|
|
||||||
% (
|
|
||||||
exp_dir1,
|
exp_dir1,
|
||||||
sr2,
|
sr2,
|
||||||
1 if if_f0_3 else 0,
|
1 if if_f0_3 else 0,
|
||||||
@ -1260,7 +1263,6 @@ def train1key(
|
|||||||
1 if if_save_every_weights18 == i18n("是") else 0,
|
1 if if_save_every_weights18 == i18n("是") else 0,
|
||||||
version19,
|
version19,
|
||||||
)
|
)
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
cmd = (
|
cmd = (
|
||||||
config.python_cmd
|
config.python_cmd
|
||||||
|
Loading…
Reference in New Issue
Block a user