mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
23 lines
967 B
Python
23 lines
967 B
Python
import os
|
|
from data.ModelSlot import DDSPSVCModelSlot
|
|
from voice_changer.utils.LoadModelParams import LoadModelParams
|
|
from voice_changer.utils.ModelSlotGenerator import ModelSlotGenerator
|
|
|
|
|
|
class DDSP_SVCModelSlotGenerator(ModelSlotGenerator):
|
|
@classmethod
|
|
def loadModel(cls, props: LoadModelParams):
|
|
slotInfo: DDSPSVCModelSlot = DDSPSVCModelSlot()
|
|
for file in props.files:
|
|
if file.kind == "ddspSvcModelConfig":
|
|
slotInfo.configFile = file.name
|
|
elif file.kind == "ddspSvcModel":
|
|
slotInfo.modelFile = file.name
|
|
elif file.kind == "ddspSvcDiffusionConfig":
|
|
slotInfo.diffConfigFile = file.name
|
|
elif file.kind == "ddspSvcDiffusion":
|
|
slotInfo.diffModelFile = file.name
|
|
slotInfo.isONNX = slotInfo.modelFile.endswith(".onnx")
|
|
slotInfo.name = os.path.splitext(os.path.basename(slotInfo.modelFile))[0]
|
|
return slotInfo
|