1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

fix: train parameter concating

This commit is contained in:
源文雨
2024-06-04 01:35:05 +09:00
parent 78f11cf365
commit 50cb284a93

View File

@@ -589,7 +589,7 @@ def click_train(
) )
) )
if gpus16: if gpus16:
cmd += '-g "%s"' % (gpus16) cmd += ' -g "%s"' % (gpus16)
logger.info("Execute: " + cmd) logger.info("Execute: " + cmd)
p = Popen(cmd, shell=True, cwd=now_dir) p = Popen(cmd, shell=True, cwd=now_dir)
@@ -663,33 +663,25 @@ def train_index(exp_dir1, version19):
batch_size_add = 8192 batch_size_add = 8192
for i in range(0, big_npy.shape[0], batch_size_add): for i in range(0, big_npy.shape[0], batch_size_add):
index.add(big_npy[i : i + batch_size_add]) index.add(big_npy[i : i + batch_size_add])
faiss.write_index( index_save_path = "%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index" % (
index, exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19
"%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
) )
infos.append( faiss.write_index(index, index_save_path)
"成功构建索引 added_IVF%s_Flat_nprobe_%s_%s_%s.index" infos.append(f"{i18n("成功构建索引到")} {index_save_path}")
% (n_ivf, index_ivf.nprobe, exp_dir1, version19) link_target = "%s/%s_IVF%s_Flat_nprobe_%s_%s_%s.index" % (
outside_index_root,
exp_dir1,
n_ivf,
index_ivf.nprobe,
exp_dir1,
version19,
) )
try: try:
link = os.link if platform.system() == "Windows" else os.symlink link = os.link if platform.system() == "Windows" else os.symlink
link( link(index_save_path, link_target)
"%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index" infos.append(f"{i18n("链接索引到外部")} {link_target}")
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
"%s/%s_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (
outside_index_root,
exp_dir1,
n_ivf,
index_ivf.nprobe,
exp_dir1,
version19,
),
)
infos.append("链接索引到外部-%s" % (outside_index_root))
except: except:
infos.append("链接索引到外部-%s失败" % (outside_index_root)) infos.append(f"{i18n("链接索引到外部")} {link_target} {i18n("失败")}")
# faiss.write_index(index, '%s/added_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19)) # faiss.write_index(index, '%s/added_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
# infos.append("成功构建索引added_IVF%s_Flat_FastScan_%s.index"%(n_ivf,version19)) # infos.append("成功构建索引added_IVF%s_Flat_FastScan_%s.index"%(n_ivf,version19))