voice-changer/server/voice_changer/EasyVC/EasyVCModelSlotGenerator.py
2024-02-28 23:08:49 +09:00

18 lines
630 B
Python

import os
from data.ModelSlot import EasyVCModelSlot
from voice_changer.utils.LoadModelParams import LoadModelParams
from voice_changer.utils.ModelSlotGenerator import ModelSlotGenerator
class EasyVCModelSlotGenerator(ModelSlotGenerator):
@classmethod
def loadModel(cls, props: LoadModelParams):
slotInfo: EasyVCModelSlot = EasyVCModelSlot()
for file in props.files:
if file.kind == "easyVCModel":
slotInfo.modelFile = file.name
slotInfo.name = os.path.splitext(os.path.basename(slotInfo.modelFile))[0]
slotInfo.slotIndex = props.slot
return slotInfo