From 267192fd92d01e71da6695d7362722d3086bcecd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 22:31:55 +0900 Subject: [PATCH] chore(format): run black on dev (#1750) Co-authored-by: github-actions[bot] --- configs/config.py | 2 +- infer-web.py | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/configs/config.py b/configs/config.py index fe18769..a330fb5 100644 --- a/configs/config.py +++ b/configs/config.py @@ -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)) diff --git a/infer-web.py b/infer-web.py index 9a129b6..f574e71 100644 --- a/infer-web.py +++ b/infer-web.py @@ -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)