From 1890584496b0093253d9caad7f1347975fca82f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 30 Aug 2023 00:27:23 +0800 Subject: [PATCH] fix: weights folder --- configs/config.json | 2 +- infer-web.py | 2 +- infer/lib/train/process_ckpt.py | 2 +- infer/modules/uvr5/mdxnet.py | 2 +- tools/calc_rvc_model_similarity.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/config.json b/configs/config.json index 6bf4f6b..d8a6936 100644 --- a/configs/config.json +++ b/configs/config.json @@ -1,5 +1,5 @@ { - "pth_path": "weights/kikiV1.pth", + "pth_path": "assets/weights/kikiV1.pth", "index_path": "logs/kikiV1.index", "sg_input_device": "VoiceMeeter Output (VB-Audio Vo (MME)", "sg_output_device": "VoiceMeeter Aux Input (VB-Audio (MME)", diff --git a/infer-web.py b/infer-web.py index 52b22c3..20c3cbf 100644 --- a/infer-web.py +++ b/infer-web.py @@ -36,7 +36,7 @@ shutil.rmtree("%s/runtime/Lib/site-packages/infer_pack" % (now_dir), ignore_erro shutil.rmtree("%s/runtime/Lib/site-packages/uvr5_pack" % (now_dir), ignore_errors=True) os.makedirs(tmp, exist_ok=True) os.makedirs(os.path.join(now_dir, "logs"), exist_ok=True) -os.makedirs(os.path.join(now_dir, "weights"), exist_ok=True) +os.makedirs(os.path.join(now_dir, "assets/weights"), exist_ok=True) warnings.filterwarnings("ignore") torch.manual_seed(114514) diff --git a/infer/lib/train/process_ckpt.py b/infer/lib/train/process_ckpt.py index 887dc71..2529ccf 100644 --- a/infer/lib/train/process_ckpt.py +++ b/infer/lib/train/process_ckpt.py @@ -197,7 +197,7 @@ def change_info(path, info, name): ckpt["info"] = info if name == "": name = os.path.basename(path) - torch.save(ckpt, "weights/%s" % name) + torch.save(ckpt, "assets/weights/%s" % name) return "Success." except: return traceback.format_exc() diff --git a/infer/modules/uvr5/mdxnet.py b/infer/modules/uvr5/mdxnet.py index 500b49e..c21c989 100644 --- a/infer/modules/uvr5/mdxnet.py +++ b/infer/modules/uvr5/mdxnet.py @@ -226,7 +226,7 @@ class Predictor: class MDXNetDereverb: def __init__(self, chunks, device): - self.onnx = "uvr5_weights/onnx_dereverb_By_FoxJoy" + self.onnx = "assets/uvr5_weights/onnx_dereverb_By_FoxJoy" self.shifts = 10 # 'Predict with randomised equivariant stabilisation' self.mixing = "min_mag" # ['default','min_mag','max_mag'] self.chunks = chunks diff --git a/tools/calc_rvc_model_similarity.py b/tools/calc_rvc_model_similarity.py index 3f74ca5..9063efb 100644 --- a/tools/calc_rvc_model_similarity.py +++ b/tools/calc_rvc_model_similarity.py @@ -89,6 +89,6 @@ def main(path, root): if __name__ == "__main__": - query_path = r"weights\mi v3.pth" - reference_root = r"weights" + query_path = r"assets\weights\mi v3.pth" + reference_root = r"assets\weights" main(query_path, reference_root)