optimize: move values1.json to configs/config.json

This commit is contained in:
源文雨 2023-08-27 00:46:03 +08:00
parent e67cf66fe0
commit edbf4b5139
3 changed files with 17 additions and 4 deletions

14
configs/config.json Normal file
View File

@ -0,0 +1,14 @@
{
"pth_path": "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)",
"threhold": -45.0,
"pitch": 0.0,
"index_rate": 1.0,
"block_time": 0.09,
"crossfade_length": 0.15,
"extra_time": 5.0,
"n_cpu": 8.0,
"f0method": "rmvpe"
}

View File

@ -92,14 +92,14 @@ if __name__ == "__main__":
def load(self):
input_devices, output_devices, _, _ = self.get_devices()
try:
with open("values1.json", "r") as j:
with open("configs/config.json", "r") as j:
data = json.load(j)
data["pm"] = data["f0method"] == "pm"
data["harvest"] = data["f0method"] == "harvest"
data["crepe"] = data["f0method"] == "crepe"
data["rmvpe"] = data["f0method"] == "rmvpe"
except:
with open("values1.json", "w") as j:
with open("configs/config.json", "w") as j:
data = {
"pth_path": " ",
"index_path": " ",
@ -349,7 +349,7 @@ if __name__ == "__main__":
].index(True)
],
}
with open("values1.json", "w") as j:
with open("configs/config.json", "w") as j:
json.dump(settings, j)
if event == "stop_vc" and self.flag_vc == True:
self.flag_vc = False

View File

@ -1 +0,0 @@
{"pth_path": "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)", "threhold": -45.0, "pitch": 0.0, "index_rate": 1.0, "block_time": 0.09, "crossfade_length": 0.15, "extra_time": 5.0, "n_cpu": 8.0, "f0method": "rmvpe"}