55 lines
1.4 KiB
Python
Raw Normal View History

2023-04-28 07:36:08 +09:00
from dataclasses import dataclass, field
2023-05-16 10:38:23 +09:00
from ModelSample import RVCModelSample
2023-04-28 07:36:08 +09:00
from voice_changer.RVC.ModelSlot import ModelSlot
@dataclass
class RVCSettings:
gpu: int = 0
dstId: int = 0
2023-05-04 12:21:34 +09:00
f0Detector: str = "harvest" # dio or harvest
2023-04-28 07:36:08 +09:00
tran: int = 20
silentThreshold: float = 0.00001
extraConvertSize: int = 1024 * 32
clusterInferRatio: float = 0.1
framework: str = "PyTorch" # PyTorch or ONNX
modelSlots: list[ModelSlot] = field(
2023-05-15 04:24:58 +09:00
default_factory=lambda: [
ModelSlot(), # 1
ModelSlot(), # 2
ModelSlot(), # 3
ModelSlot(), # 4
ModelSlot(), # 5
ModelSlot(), # 6(merged)
]
2023-04-28 07:36:08 +09:00
)
2023-05-16 10:38:23 +09:00
sampleModels: list[RVCModelSample] = field(default_factory=lambda: [])
2023-04-28 07:36:08 +09:00
indexRatio: float = 0
rvcQuality: int = 0
silenceFront: int = 1 # 0:off, 1:on
modelSamplingRate: int = 48000
modelSlotIndex: int = -1
speakers: dict[str, int] = field(default_factory=lambda: {})
2023-05-02 20:57:12 +09:00
isHalf: int = 1 # 0:off, 1:on
2023-05-04 23:50:52 +09:00
enableDirectML: int = 0 # 0:off, 1:on
2023-04-28 07:36:08 +09:00
# ↓mutableな物だけ列挙
intData = [
"gpu",
"dstId",
"tran",
"extraConvertSize",
"rvcQuality",
"modelSamplingRate",
"silenceFront",
"modelSlotIndex",
2023-05-02 20:57:12 +09:00
"isHalf",
2023-05-04 23:50:52 +09:00
"enableDirectML",
2023-04-28 07:36:08 +09:00
]
floatData = ["silentThreshold", "indexRatio"]
strData = ["framework", "f0Detector"]