From 228068b667e6f3c7d46c3331b720d7e4b81a53fb Mon Sep 17 00:00:00 2001 From: wataru Date: Tue, 25 Apr 2023 16:59:58 +0900 Subject: [PATCH] bugfix: onnx embedchannels load miss, refactor: modelslot --- client/lib/src/const.ts | 17 ++++++++++++++++- server/voice_changer/RVC/RVC.py | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/client/lib/src/const.ts b/client/lib/src/const.ts index 530e0073..0a0a91a8 100644 --- a/client/lib/src/const.ts +++ b/client/lib/src/const.ts @@ -138,13 +138,28 @@ export type VoiceChangerServerSetting = { inputSampleRate: InputSampleRate } +type ModelSlot = { + onnxModelFile: string, + pyTorchModelFile: string + featureFile: string, + indexFile: string, + + defaultTrans: number, + + modelType: number, + embChannels: number, + f0: boolean, + samplingRate: number + deprecated: boolean +} + export type ServerInfo = VoiceChangerServerSetting & { status: string configFile: string, pyTorchModelFile: string, onnxModelFile: string, onnxExecutionProviders: OnnxExecutionProvider[] - modelSlots: any[] + modelSlots: ModelSlot[] } export type ServerInfoSoVitsSVC = ServerInfo & { diff --git a/server/voice_changer/RVC/RVC.py b/server/voice_changer/RVC/RVC.py index 1f06f9f3..38848081 100644 --- a/server/voice_changer/RVC/RVC.py +++ b/server/voice_changer/RVC/RVC.py @@ -175,7 +175,7 @@ class RVC: def _setInfoByONNX(self, slot, file): tmp_onnx_session = ModelWrapper(file) self.settings.modelSlots[slot].modelType = tmp_onnx_session.getModelType() - self.settings.modelSlots[slot].embChannelsOnnx = tmp_onnx_session.getEmbChannels() + self.settings.modelSlots[slot].embChannels = tmp_onnx_session.getEmbChannels() self.settings.modelSlots[slot].f0 = tmp_onnx_session.getF0() self.settings.modelSlots[slot].samplingRate = tmp_onnx_session.getSamplingRate() self.settings.modelSlots[slot].deprecated = tmp_onnx_session.getDeprecated() @@ -493,6 +493,7 @@ class RVC: output_file_simple = os.path.splitext(os.path.basename(pyTorchModelFile))[0] + "_simple.onnx" output_path = os.path.join(TMP_DIR, output_file) output_path_simple = os.path.join(TMP_DIR, output_file_simple) + print("embChannels", self.settings.modelSlots[self.settings.modelSlotIndex].embChannels) metadata = { "application": "VC_CLIENT", "version": "1",