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,9 +169,9 @@ 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())
|
||||||
self.is_half = False
|
self.is_half = False
|
||||||
else:
|
else:
|
||||||
|
|
100
infer-web.py
100
infer-web.py
|
@ -570,10 +570,12 @@ def if_done_multi(done, ps):
|
||||||
if flag == 1:
|
if flag == 1:
|
||||||
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,11 +618,15 @@ 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 = (
|
||||||
now_dir,
|
get_quoted_python_cmd()
|
||||||
exp_dir,
|
+ ' extract_f0_print.py "%s/logs/%s" %s %s'
|
||||||
n_p,
|
% (
|
||||||
f0method,
|
now_dir,
|
||||||
|
exp_dir,
|
||||||
|
n_p,
|
||||||
|
f0method,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
print(cmd)
|
print(cmd)
|
||||||
p = Popen(
|
p = Popen(
|
||||||
|
@ -930,24 +936,20 @@ 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()
|
exp_dir1,
|
||||||
+ ' 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'
|
sr2,
|
||||||
% (
|
1 if if_f0_3 else 0,
|
||||||
exp_dir1,
|
batch_size12,
|
||||||
sr2,
|
gpus16,
|
||||||
1 if if_f0_3 else 0,
|
total_epoch11,
|
||||||
batch_size12,
|
save_epoch10,
|
||||||
gpus16,
|
"-pg %s" % pretrained_G14 if pretrained_G14 != "" else "",
|
||||||
total_epoch11,
|
"-pd %s" % pretrained_D15 if pretrained_D15 != "" else "",
|
||||||
save_epoch10,
|
1 if if_save_latest13 == i18n("是") else 0,
|
||||||
"-pg %s" % pretrained_G14 if pretrained_G14 != "" else "",
|
1 if if_cache_gpu17 == i18n("是") else 0,
|
||||||
"-pd %s" % pretrained_D15 if pretrained_D15 != "" else "",
|
1 if if_save_every_weights18 == i18n("是") else 0,
|
||||||
1 if if_save_latest13 == i18n("是") else 0,
|
version19,
|
||||||
1 if if_cache_gpu17 == i18n("是") else 0,
|
|
||||||
1 if if_save_every_weights18 == i18n("是") else 0,
|
|
||||||
version19,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
cmd = (
|
cmd = (
|
||||||
|
@ -1163,13 +1165,17 @@ 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 = (
|
||||||
config.device,
|
get_quoted_python_cmd()
|
||||||
leng,
|
+ ' extract_feature_print.py %s %s %s %s "%s" %s'
|
||||||
idx,
|
% (
|
||||||
n_g,
|
config.device,
|
||||||
model_log_dir,
|
leng,
|
||||||
version19,
|
idx,
|
||||||
|
n_g,
|
||||||
|
model_log_dir,
|
||||||
|
version19,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
yield get_info_str(cmd)
|
yield get_info_str(cmd)
|
||||||
p = Popen(
|
p = Popen(
|
||||||
|
@ -1242,24 +1248,20 @@ 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()
|
exp_dir1,
|
||||||
+ ' 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'
|
sr2,
|
||||||
% (
|
1 if if_f0_3 else 0,
|
||||||
exp_dir1,
|
batch_size12,
|
||||||
sr2,
|
gpus16,
|
||||||
1 if if_f0_3 else 0,
|
total_epoch11,
|
||||||
batch_size12,
|
save_epoch10,
|
||||||
gpus16,
|
"-pg %s" % pretrained_G14 if pretrained_G14 != "" else "",
|
||||||
total_epoch11,
|
"-pd %s" % pretrained_D15 if pretrained_D15 != "" else "",
|
||||||
save_epoch10,
|
1 if if_save_latest13 == i18n("是") else 0,
|
||||||
"-pg %s" % pretrained_G14 if pretrained_G14 != "" else "",
|
1 if if_cache_gpu17 == i18n("是") else 0,
|
||||||
"-pd %s" % pretrained_D15 if pretrained_D15 != "" else "",
|
1 if if_save_every_weights18 == i18n("是") else 0,
|
||||||
1 if if_save_latest13 == i18n("是") else 0,
|
version19,
|
||||||
1 if if_cache_gpu17 == i18n("是") else 0,
|
|
||||||
1 if if_save_every_weights18 == i18n("是") else 0,
|
|
||||||
version19,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
cmd = (
|
cmd = (
|
||||||
|
|
Loading…
Reference in New Issue