1
0
mirror of synced 2024-11-23 23:21:03 +01:00

chore(format): run black on dev (#1750)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2024-01-22 22:31:55 +09:00 committed by GitHub
parent 380fd52085
commit 267192fd92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 11 deletions

View File

@ -132,7 +132,7 @@ class Config:
strr = f.read().replace("true", "false")
with open(f"configs/inuse/{config_file}", "w") as f:
f.write(strr)
logger.info("overwrite "+config_file)
logger.info("overwrite " + config_file)
self.preprocess_per = 3.0
logger.info("overwrite preprocess_per to %d" % (self.preprocess_per))

View File

@ -139,12 +139,16 @@ for name in os.listdir(weight_root):
if name.endswith(".pth"):
names.append(name)
index_paths = []
def lookup_indices(index_root):
global index_paths
for root, dirs, files in os.walk(index_root, topdown=False):
for name in files:
if name.endswith(".index") and "trained" not in name:
index_paths.append("%s/%s" % (root, name))
lookup_indices(index_root)
lookup_indices(outside_index_root)
uvr5_names = []
@ -669,18 +673,18 @@ def train_index(exp_dir1, version19):
"%s/trained_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
"%s/%s_IVF%s_Flat_nprobe_%s_%s_%s.index"
% (outside_index_root, exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
)
infos.append(
"链接索引到%s"
% (outside_index_root)
% (
outside_index_root,
exp_dir,
n_ivf,
index_ivf.nprobe,
exp_dir1,
version19,
),
)
infos.append("链接索引到%s" % (outside_index_root))
except:
infos.append(
"链接索引到%s失败"
% (outside_index_root)
)
infos.append("链接索引到%s失败" % (outside_index_root))
infos.append("adding")
yield "\n".join(infos)