mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
bugfix: onnx embedchannels load miss, refactor: modelslot
This commit is contained in:
parent
cbc454ebf7
commit
228068b667
@ -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 & {
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user