MCPcopy Index your code
hub / github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI / set_values

Method set_values

gui_v1.py:505–542  ·  view source on GitHub ↗
(self, values)

Source from the content-addressed store, hash-verified

503 stream_latency = -1
504
505 def set_values(self, values):
506 if len(values["pth_path"].strip()) == 0:
507 sg.popup(i18n("请选择pth文件"))
508 return False
509 if len(values["index_path"].strip()) == 0:
510 sg.popup(i18n("请选择index文件"))
511 return False
512 pattern = re.compile("[^\x00-\x7F]+")
513 if pattern.findall(values["pth_path"]):
514 sg.popup(i18n("pth文件路径不可包含中文"))
515 return False
516 if pattern.findall(values["index_path"]):
517 sg.popup(i18n("index文件路径不可包含中文"))
518 return False
519 self.set_devices(values["sg_input_device"], values["sg_output_device"])
520 self.config.use_jit = False # values["use_jit"]
521 # self.device_latency = values["device_latency"]
522 self.gui_config.pth_path = values["pth_path"]
523 self.gui_config.index_path = values["index_path"]
524 self.gui_config.threhold = values["threhold"]
525 self.gui_config.pitch = values["pitch"]
526 self.gui_config.block_time = values["block_time"]
527 self.gui_config.crossfade_time = values["crossfade_length"]
528 self.gui_config.extra_time = values["extra_time"]
529 self.gui_config.I_noise_reduce = values["I_noise_reduce"]
530 self.gui_config.O_noise_reduce = values["O_noise_reduce"]
531 self.gui_config.rms_mix_rate = values["rms_mix_rate"]
532 self.gui_config.index_rate = values["index_rate"]
533 self.gui_config.n_cpu = values["n_cpu"]
534 self.gui_config.f0method = ["pm", "harvest", "crepe", "rmvpe"][
535 [
536 values["pm"],
537 values["harvest"],
538 values["crepe"],
539 values["rmvpe"],
540 ].index(True)
541 ]
542 return True
543
544 def start_vc(self):
545 torch.cuda.empty_cache()

Callers 1

event_handlerMethod · 0.95

Calls 1

set_devicesMethod · 0.95

Tested by

no test coverage detected