bugfix: onnx embedchannels load miss, refactor: modelslot

This commit is contained in:
wataru 2023-04-25 16:59:58 +09:00
parent cbc454ebf7
commit 228068b667
2 changed files with 18 additions and 2 deletions

View File

@ -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 & {

View File

@ -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",