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

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