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