voice-changer/server/voice_changer/DDSP_SVC/DDSP_SVCSetting.py

50 lines
1.2 KiB
Python
Raw Normal View History

2023-05-07 23:51:24 +03:00
from dataclasses import dataclass, field
2023-05-08 12:02:15 +03:00
from voice_changer.DDSP_SVC.ModelSlot import ModelSlot
2023-05-07 23:51:24 +03:00
@dataclass
class DDSP_SVCSettings:
gpu: int = 0
2023-05-08 12:02:15 +03:00
dstId: int = 1
2023-05-07 23:51:24 +03:00
2023-05-08 12:02:15 +03:00
f0Detector: str = "dio" # dio or harvest or crepe # parselmouth
2023-05-07 23:51:24 +03:00
tran: int = 20
silentThreshold: float = 0.00001
extraConvertSize: int = 1024 * 32
2023-05-08 23:04:34 +03:00
useEnhancer: int = 0
useDiff: int = 1
2023-05-13 19:04:29 +03:00
# useDiffDpm: int = 0
diffMethod: str = "dpm-solver" # "pndm", "dpm-solver"
2023-05-08 23:04:34 +03:00
useDiffSilence: int = 0
diffAcc: int = 20
diffSpkId: int = 1
kStep: int = 120
threshold: int = -45
2023-05-07 23:51:24 +03:00
framework: str = "PyTorch" # PyTorch or ONNX
pyTorchModelFile: str = ""
onnxModelFile: str = ""
configFile: str = ""
speakers: dict[str, int] = field(default_factory=lambda: {})
2023-05-08 12:02:15 +03:00
modelSlotIndex: int = -1
modelSlots: list[ModelSlot] = field(default_factory=lambda: [ModelSlot()])
2023-05-07 23:51:24 +03:00
# ↓mutableな物だけ列挙
intData = [
"gpu",
"dstId",
"tran",
"extraConvertSize",
2023-05-08 23:04:34 +03:00
"useEnhancer",
"useDiff",
2023-05-13 19:04:29 +03:00
# "useDiffDpm",
2023-05-08 23:04:34 +03:00
"useDiffSilence",
"diffAcc",
"diffSpkId",
"kStep",
2023-05-07 23:51:24 +03:00
]
2023-05-08 12:02:15 +03:00
floatData = ["silentThreshold"]
2023-05-13 19:04:29 +03:00
strData = ["framework", "f0Detector", "diffMethod"]