voice-changer/server/voice_changer/utils/LoadModelParams.py

44 lines
856 B
Python
Raw Permalink Normal View History

2023-04-28 00:39:51 +03:00
from dataclasses import dataclass
2023-06-19 05:40:16 +03:00
from const import VoiceChangerType
from typing import Literal, TypeAlias
LoadModelParamFileKind: TypeAlias = Literal[
"mmvcv13Config",
"mmvcv13Model",
"mmvcv15Config",
"mmvcv15Model",
2023-06-25 12:02:43 +03:00
"mmvcv15Correspondence",
2023-06-19 05:40:16 +03:00
"soVitsSvc40Config",
"soVitsSvc40Model",
"soVitsSvc40Cluster",
"rvcModel",
"rvcIndex",
"ddspSvcModel",
"ddspSvcModelConfig",
"ddspSvcDiffusion",
"ddspSvcDiffusionConfig",
2023-07-12 18:59:48 +03:00
"diffusionSVCModel",
2023-08-09 10:55:59 +03:00
"beatriceModel",
2023-11-12 17:10:58 +03:00
"llvcModel",
"llvcConfig",
2024-02-28 17:08:49 +03:00
"easyVCModel",
2023-06-19 05:40:16 +03:00
]
@dataclass
class LoadModelParamFile:
name: str
kind: LoadModelParamFileKind
2023-06-20 00:39:39 +03:00
dir: str
2023-06-19 05:40:16 +03:00
@dataclass
2023-06-21 03:18:51 +03:00
class LoadModelParams:
2023-06-19 05:40:16 +03:00
voiceChangerType: VoiceChangerType
slot: int
isSampleMode: bool
sampleId: str
files: list[LoadModelParamFile]
2023-06-21 03:18:51 +03:00
params: dict