diff --git a/server/MMVCServerSIO.py b/server/MMVCServerSIO.py index b5b0f773..99eaaf0b 100755 --- a/server/MMVCServerSIO.py +++ b/server/MMVCServerSIO.py @@ -9,6 +9,7 @@ import argparse from Exceptions import WeightDownladException from downloader.SampleDownloader import downloadInitialSamples from downloader.WeightDownloader import downloadWeight +from voice_changer.VoiceChangerParamsManager import VoiceChangerParamsManager from voice_changer.utils.VoiceChangerParams import VoiceChangerParams @@ -96,6 +97,8 @@ voiceChangerParams = VoiceChangerParams( rmvpe=args.rmvpe, sample_mode=args.sample_mode, ) +vcparams = VoiceChangerParamsManager.get_instance() +vcparams.setParams(voiceChangerParams) printMessage(f"Booting PHASE :{__name__}", level=2) diff --git a/server/voice_changer/DiffusionSVC/DiffusionSVCModelSlotGenerator.py b/server/voice_changer/DiffusionSVC/DiffusionSVCModelSlotGenerator.py index f06338ec..7dbb1bdb 100644 --- a/server/voice_changer/DiffusionSVC/DiffusionSVCModelSlotGenerator.py +++ b/server/voice_changer/DiffusionSVC/DiffusionSVCModelSlotGenerator.py @@ -1,8 +1,6 @@ import os -from const import EnumInferenceTypes from dataclasses import asdict -import onnxruntime -import json + from data.ModelSlot import DiffusionSVCModelSlot, ModelSlot, RVCModelSlot from voice_changer.DiffusionSVC.inferencer.diffusion_svc_model.diffusion.unit2mel import load_model_vocoder_from_combo @@ -45,7 +43,7 @@ class DiffusionSVCModelSlotGenerator(ModelSlotGenerator): def _setInfoByPytorch(cls, slot: DiffusionSVCModelSlot): vcparams = VoiceChangerParamsManager.get_instance().params modelPath = os.path.join(vcparams.model_dir, str(slot.slotIndex), os.path.basename(slot.modelFile)) - + diff_model, diff_args, naive_model, naive_args = load_model_vocoder_from_combo(modelPath, device="cpu") slot.kStepMax = diff_args.model.k_step_max slot.nLayers = diff_args.model.n_layers diff --git a/server/voice_changer/DiffusionSVC/inferencer/DiffusionSVCInferencer.py b/server/voice_changer/DiffusionSVC/inferencer/DiffusionSVCInferencer.py index 7dd8ac88..3a364f2d 100644 --- a/server/voice_changer/DiffusionSVC/inferencer/DiffusionSVCInferencer.py +++ b/server/voice_changer/DiffusionSVC/inferencer/DiffusionSVCInferencer.py @@ -133,7 +133,6 @@ class DiffusionSVCInferencer(Inferencer): out_wav *= mask else: out_wav = self.vocoder_onnx.infer(gt_spec, pitch, silence_front, mask) - # out_wav = self.vocoder_onnx.infer(gt_spec, pitch, 0, mask) # print("[ ----Timer::3: ]", t.secs) return out_wav.squeeze() diff --git a/server/voice_changer/VoiceChangerManager.py b/server/voice_changer/VoiceChangerManager.py index 66d4765e..70f3aebb 100644 --- a/server/voice_changer/VoiceChangerManager.py +++ b/server/voice_changer/VoiceChangerManager.py @@ -121,8 +121,6 @@ class VoiceChangerManager(ServerDeviceCallbacks): @classmethod def get_instance(cls, params: VoiceChangerParams): if cls._instance is None: - vcparams = VoiceChangerParamsManager.get_instance() - vcparams.setParams(params) cls._instance = cls(params) return cls._instance