mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-09 03:37:51 +03:00
sample update
This commit is contained in:
parent
55ea032a86
commit
3233377abd
4
client/demo/dist/index.js
vendored
4
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -70,7 +70,7 @@ export const StartButtonRow = (_props: StartButtonRowProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}, [guiState.isConverting, appState.clientSetting.start, appState.clientSetting.stop, appState.serverSetting.serverSetting, , appState.serverSetting.updateServerSettings])
|
}, [guiState.isConverting, appState.clientSetting.start, appState.clientSetting.stop, appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings])
|
||||||
|
|
||||||
return startButtonRow
|
return startButtonRow
|
||||||
}
|
}
|
@ -39,7 +39,7 @@ export const ModelSwitchRow = (_props: ModelSwitchRowProps) => {
|
|||||||
if (x.modelType == "pyTorchRVC" || x.modelType == "pyTorchRVCNono") {
|
if (x.modelType == "pyTorchRVC" || x.modelType == "pyTorchRVCNono") {
|
||||||
return "org"
|
return "org"
|
||||||
} else if (x.modelType == "pyTorchRVCv2" || x.modelType == "pyTorchRVCv2Nono") {
|
} else if (x.modelType == "pyTorchRVCv2" || x.modelType == "pyTorchRVCv2Nono") {
|
||||||
return "orv_v2"
|
return "org_v2"
|
||||||
} else if (x.modelType == "pyTorchWebUI" || x.modelType == "pyTorchWebUINono") {
|
} else if (x.modelType == "pyTorchWebUI" || x.modelType == "pyTorchWebUINono") {
|
||||||
return "webui"
|
return "webui"
|
||||||
} else {
|
} else {
|
||||||
|
@ -15,6 +15,7 @@ export const ServerOpertationRow = (props: ServerOpertationRowProps) => {
|
|||||||
const guiState = useGuiState()
|
const guiState = useGuiState()
|
||||||
|
|
||||||
const serverOpertationRow = useMemo(() => {
|
const serverOpertationRow = useMemo(() => {
|
||||||
|
console.log("UPDATE OPERATION ROW:::::::::::::::::::::::")
|
||||||
|
|
||||||
const onnxExportButtonAction = async () => {
|
const onnxExportButtonAction = async () => {
|
||||||
|
|
||||||
@ -78,7 +79,7 @@ export const ServerOpertationRow = (props: ServerOpertationRowProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}, [appState.getInfo, appState.serverSetting.serverSetting])
|
}, [appState.getInfo, appState.serverSetting.serverSetting, guiState.isConverting])
|
||||||
|
|
||||||
return serverOpertationRow
|
return serverOpertationRow
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ export const MergeLabRow = (_props: MergeLabRowProps) => {
|
|||||||
if (modelInfo.modelType == "pyTorchRVC" || modelInfo.modelType == "pyTorchRVCNono") {
|
if (modelInfo.modelType == "pyTorchRVC" || modelInfo.modelType == "pyTorchRVCNono") {
|
||||||
return "org"
|
return "org"
|
||||||
} else if (modelInfo.modelType == "pyTorchRVCv2" || modelInfo.modelType == "pyTorchRVCv2Nono") {
|
} else if (modelInfo.modelType == "pyTorchRVCv2" || modelInfo.modelType == "pyTorchRVCv2Nono") {
|
||||||
return "orv_v2"
|
return "g_v2"
|
||||||
} else if (modelInfo.modelType == "pyTorchWebUI" || modelInfo.modelType == "pyTorchWebUINono") {
|
} else if (modelInfo.modelType == "pyTorchWebUI" || modelInfo.modelType == "pyTorchWebUINono") {
|
||||||
return "webui"
|
return "webui"
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,7 +12,6 @@ class RVCModelSample:
|
|||||||
name: str = ""
|
name: str = ""
|
||||||
modelUrl: str = ""
|
modelUrl: str = ""
|
||||||
indexUrl: str = ""
|
indexUrl: str = ""
|
||||||
featureUrl: str = ""
|
|
||||||
termsOfUseUrl: str = ""
|
termsOfUseUrl: str = ""
|
||||||
credit: str = ""
|
credit: str = ""
|
||||||
description: str = ""
|
description: str = ""
|
||||||
|
@ -101,8 +101,8 @@ class ServerAudioDeviceTypes(Enum):
|
|||||||
|
|
||||||
|
|
||||||
SAMPLES_JSONS = [
|
SAMPLES_JSONS = [
|
||||||
"https://huggingface.co/wok000/vcclient_model/raw/main/samples_0001.json",
|
"https://huggingface.co/wok000/vcclient_model/raw/main/samples_0003_t.json",
|
||||||
"https://huggingface.co/wok000/vcclient_model/raw/main/samples_0002.json",
|
"https://huggingface.co/wok000/vcclient_model/raw/main/samples_0003_o.json",
|
||||||
]
|
]
|
||||||
RVC_MODEL_DIRNAME = "rvc"
|
RVC_MODEL_DIRNAME = "rvc"
|
||||||
RVC_MAX_SLOT_NUM = 5
|
RVC_MAX_SLOT_NUM = 5
|
||||||
|
74
server/samples_0003_o.json
Normal file
74
server/samples_0003_o.json
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"RVC": [
|
||||||
|
{
|
||||||
|
"id": "KikotoKurage_o",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "onnx"],
|
||||||
|
"name": "黄琴海月",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_kurage/kikoto_kurage_v2_40k_e100_simple.onnx",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_kurage/added_IVF5181_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/raw/main/rvc_v2_alpha/kikoto_kurage/terms_of_use.txt",
|
||||||
|
"credit": "黄琴海月",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "KikotoMahiro_o",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "onnx"],
|
||||||
|
"name": "黄琴まひろ",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_mahiro/kikoto_mahiro_v2_40k_simple.onnx",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_mahiro/added_IVF6881_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "",
|
||||||
|
"credit": "黄琴まひろ",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "TokinaShigure_o",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "onnx"],
|
||||||
|
"name": "刻鳴時雨",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tokina_shigure/tokina_shigure_v2_40k_e100_simple.onnx",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tokina_shigure/added_IVF2736_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/raw/main/rvc_v2_alpha/tokina_shigure/terms_of_use.txt",
|
||||||
|
"credit": "刻鳴時雨",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Amitaro_o",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "onnx"],
|
||||||
|
"name": "あみたろ",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/amitaro/amitaro_v2_40k_e100_simple.onnx",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/amitaro/added_IVF3139_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/raw/main/rvc_v2_alpha/amitaro/terms_of_use.txt",
|
||||||
|
"credit": "あみたろ",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Tsukuyomi-chan_o",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "onnx"],
|
||||||
|
"name": "つくよみちゃん",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tsukuyomi-chan/tsukuyomi_v2_40k_e100_simple.onnx",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tsukuyomi-chan/added_IVF7852_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/blob/main/rvc_v2_alpha/tsukuyomi-chan/terms_of_use.txt",
|
||||||
|
"credit": "つくよみちゃん",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
74
server/samples_0003_t.json
Normal file
74
server/samples_0003_t.json
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"RVC": [
|
||||||
|
{
|
||||||
|
"id": "KikotoKurage_t",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "torch"],
|
||||||
|
"name": "黄琴海月",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_kurage/kikoto_kurage_v2_40k_e100.pth",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_kurage/added_IVF5181_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/raw/main/rvc_v2_alpha/kikoto_kurage/terms_of_use.txt",
|
||||||
|
"credit": "黄琴海月",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "KikotoMahiro_t",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "torch"],
|
||||||
|
"name": "黄琴まひろ",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_mahiro/kikoto_mahiro_v2_40k.pth",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/kikoto_mahiro/added_IVF6881_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "",
|
||||||
|
"credit": "黄琴まひろ",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "TokinaShigure_t",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "torch"],
|
||||||
|
"name": "刻鳴時雨",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tokina_shigure/tokina_shigure_v2_40k_e100.pth",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tokina_shigure/added_IVF2736_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/raw/main/rvc_v2_alpha/tokina_shigure/terms_of_use.txt",
|
||||||
|
"credit": "刻鳴時雨",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Amitaro_t",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "torch"],
|
||||||
|
"name": "あみたろ",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/amitaro/amitaro_v2_40k_e100.pth",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/amitaro/added_IVF3139_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/raw/main/rvc_v2_alpha/amitaro/terms_of_use.txt",
|
||||||
|
"credit": "あみたろ",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Tsukuyomi-chan_t",
|
||||||
|
"lang": "ja-JP",
|
||||||
|
"tag": ["v2", "torch"],
|
||||||
|
"name": "つくよみちゃん",
|
||||||
|
"modelUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tsukuyomi-chan/tsukuyomi_v2_40k_e100.pth",
|
||||||
|
"indexUrl": "https://huggingface.co/wok000/vcclient_model/resolve/main/rvc_v2_alpha/tsukuyomi-chan/added_IVF7852_Flat_nprobe_1_v2.index.bin",
|
||||||
|
"termsOfUseUrl": "https://huggingface.co/wok000/vcclient_model/blob/main/rvc_v2_alpha/tsukuyomi-chan/terms_of_use.txt",
|
||||||
|
"credit": "つくよみちゃん",
|
||||||
|
"description": "",
|
||||||
|
"sampleRate": 40000,
|
||||||
|
"modelType": "rvc_v2",
|
||||||
|
"f0": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -17,7 +17,7 @@ class ModelSlot:
|
|||||||
samplingRate: int = -1
|
samplingRate: int = -1
|
||||||
f0: bool = True
|
f0: bool = True
|
||||||
embChannels: int = 256
|
embChannels: int = 256
|
||||||
embOutputLayter: int = 9
|
embOutputLayer: int = 9
|
||||||
useFinalProj: bool = True
|
useFinalProj: bool = True
|
||||||
deprecated: bool = False
|
deprecated: bool = False
|
||||||
embedder: EnumEmbedderTypes = EnumEmbedderTypes.hubert
|
embedder: EnumEmbedderTypes = EnumEmbedderTypes.hubert
|
||||||
|
@ -66,7 +66,7 @@ def _setInfoByPytorch(slot: ModelSlot):
|
|||||||
else EnumInferenceTypes.pyTorchRVCNono
|
else EnumInferenceTypes.pyTorchRVCNono
|
||||||
)
|
)
|
||||||
slot.embChannels = 256
|
slot.embChannels = 256
|
||||||
slot.embOutputLayter = 9
|
slot.embOutputLayer = 9
|
||||||
slot.useFinalProj = True
|
slot.useFinalProj = True
|
||||||
slot.embedder = EnumEmbedderTypes.hubert
|
slot.embedder = EnumEmbedderTypes.hubert
|
||||||
else:
|
else:
|
||||||
@ -76,7 +76,7 @@ def _setInfoByPytorch(slot: ModelSlot):
|
|||||||
else EnumInferenceTypes.pyTorchRVCv2Nono
|
else EnumInferenceTypes.pyTorchRVCv2Nono
|
||||||
)
|
)
|
||||||
slot.embChannels = 768
|
slot.embChannels = 768
|
||||||
slot.embOutputLayter = 12
|
slot.embOutputLayer = 12
|
||||||
slot.useFinalProj = False
|
slot.useFinalProj = False
|
||||||
slot.embedder = EnumEmbedderTypes.hubert
|
slot.embedder = EnumEmbedderTypes.hubert
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ def _setInfoByPytorch(slot: ModelSlot):
|
|||||||
else EnumInferenceTypes.pyTorchWebUINono
|
else EnumInferenceTypes.pyTorchWebUINono
|
||||||
)
|
)
|
||||||
slot.embChannels = cpt["config"][17]
|
slot.embChannels = cpt["config"][17]
|
||||||
slot.embOutputLayter = (
|
slot.embOutputLayer = (
|
||||||
cpt["embedder_output_layer"] if "embedder_output_layer" in cpt else 9
|
cpt["embedder_output_layer"] if "embedder_output_layer" in cpt else 9
|
||||||
)
|
)
|
||||||
if slot.embChannels == 256:
|
if slot.embChannels == 256:
|
||||||
@ -100,19 +100,19 @@ def _setInfoByPytorch(slot: ModelSlot):
|
|||||||
# DDPNモデルの情報を表示
|
# DDPNモデルの情報を表示
|
||||||
if (
|
if (
|
||||||
slot.embChannels == 256
|
slot.embChannels == 256
|
||||||
and slot.embOutputLayter == 9
|
and slot.embOutputLayer == 9
|
||||||
and slot.useFinalProj is True
|
and slot.useFinalProj is True
|
||||||
):
|
):
|
||||||
print("[Voice Changer] DDPN Model: Original v1 like")
|
print("[Voice Changer] DDPN Model: Original v1 like")
|
||||||
elif (
|
elif (
|
||||||
slot.embChannels == 768
|
slot.embChannels == 768
|
||||||
and slot.embOutputLayter == 12
|
and slot.embOutputLayer == 12
|
||||||
and slot.useFinalProj is False
|
and slot.useFinalProj is False
|
||||||
):
|
):
|
||||||
print("[Voice Changer] DDPN Model: Original v2 like")
|
print("[Voice Changer] DDPN Model: Original v2 like")
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
f"[Voice Changer] DDPN Model: ch:{slot.embChannels}, L:{slot.embOutputLayter}, FP:{slot.useFinalProj}"
|
f"[Voice Changer] DDPN Model: ch:{slot.embChannels}, L:{slot.embOutputLayer}, FP:{slot.useFinalProj}"
|
||||||
)
|
)
|
||||||
|
|
||||||
slot.embedder = cpt["embedder_name"]
|
slot.embedder = cpt["embedder_name"]
|
||||||
@ -144,10 +144,15 @@ def _setInfoByONNX(slot: ModelSlot):
|
|||||||
# slot.modelType = metadata["modelType"]
|
# slot.modelType = metadata["modelType"]
|
||||||
slot.embChannels = metadata["embChannels"]
|
slot.embChannels = metadata["embChannels"]
|
||||||
|
|
||||||
slot.embOutputLayter = (
|
slot.embOutputLayer = (
|
||||||
metadata["embedder_output_layer"]
|
metadata["embOutputLayer"] if "embOutputLayer" in metadata else 9
|
||||||
if "embedder_output_layer" in metadata
|
)
|
||||||
else 9
|
slot.useFinalProj = (
|
||||||
|
metadata["useFinalProj"]
|
||||||
|
if "useFinalProj" in metadata
|
||||||
|
else True
|
||||||
|
if slot.embChannels == 256
|
||||||
|
else False
|
||||||
)
|
)
|
||||||
|
|
||||||
if slot.embChannels == 256:
|
if slot.embChannels == 256:
|
||||||
@ -155,7 +160,23 @@ def _setInfoByONNX(slot: ModelSlot):
|
|||||||
else:
|
else:
|
||||||
slot.useFinalProj = False
|
slot.useFinalProj = False
|
||||||
|
|
||||||
print("ONNX", slot)
|
# ONNXモデルの情報を表示
|
||||||
|
if (
|
||||||
|
slot.embChannels == 256
|
||||||
|
and slot.embOutputLayer == 9
|
||||||
|
and slot.useFinalProj is True
|
||||||
|
):
|
||||||
|
print("[Voice Changer] ONNX Model: Original v1 like")
|
||||||
|
elif (
|
||||||
|
slot.embChannels == 768
|
||||||
|
and slot.embOutputLayer == 12
|
||||||
|
and slot.useFinalProj is False
|
||||||
|
):
|
||||||
|
print("[Voice Changer] ONNX Model: Original v2 like")
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
f"[Voice Changer] ONNX Model: ch:{slot.embChannels}, L:{slot.embOutputLayer}, FP:{slot.useFinalProj}"
|
||||||
|
)
|
||||||
|
|
||||||
if "embedder" not in metadata:
|
if "embedder" not in metadata:
|
||||||
slot.embedder = EnumEmbedderTypes.hubert
|
slot.embedder = EnumEmbedderTypes.hubert
|
||||||
|
@ -86,7 +86,7 @@ class RVC:
|
|||||||
if len(slot.modelFile) > 0:
|
if len(slot.modelFile) > 0:
|
||||||
self.prepareModel(i)
|
self.prepareModel(i)
|
||||||
self.settings.modelSlotIndex = i
|
self.settings.modelSlotIndex = i
|
||||||
self.switchModel()
|
self.switchModel(self.settings.modelSlotIndex)
|
||||||
self.initialLoad = False
|
self.initialLoad = False
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -115,12 +115,10 @@ class RVC:
|
|||||||
if sampleInfo is None:
|
if sampleInfo is None:
|
||||||
print("[Voice Changer] sampleInfo is None")
|
print("[Voice Changer] sampleInfo is None")
|
||||||
return
|
return
|
||||||
modelPath, indexPath, featurePath = downloadModelFiles(sampleInfo)
|
modelPath, indexPath = downloadModelFiles(sampleInfo)
|
||||||
params["files"]["rvcModel"] = modelPath
|
params["files"]["rvcModel"] = modelPath
|
||||||
if indexPath is not None:
|
if indexPath is not None:
|
||||||
params["files"]["rvcIndex"] = indexPath
|
params["files"]["rvcIndex"] = indexPath
|
||||||
if featurePath is not None:
|
|
||||||
params["files"]["rvcFeature"] = featurePath
|
|
||||||
params["credit"] = sampleInfo.credit
|
params["credit"] = sampleInfo.credit
|
||||||
params["description"] = sampleInfo.description
|
params["description"] = sampleInfo.description
|
||||||
params["name"] = sampleInfo.name
|
params["name"] = sampleInfo.name
|
||||||
@ -152,7 +150,7 @@ class RVC:
|
|||||||
if self.initialLoad:
|
if self.initialLoad:
|
||||||
self.prepareModel(target_slot_idx)
|
self.prepareModel(target_slot_idx)
|
||||||
self.settings.modelSlotIndex = target_slot_idx
|
self.settings.modelSlotIndex = target_slot_idx
|
||||||
self.switchModel()
|
self.switchModel(self.settings.modelSlotIndex)
|
||||||
self.initialLoad = False
|
self.initialLoad = False
|
||||||
elif target_slot_idx == self.currentSlot:
|
elif target_slot_idx == self.currentSlot:
|
||||||
self.prepareModel(target_slot_idx)
|
self.prepareModel(target_slot_idx)
|
||||||
@ -242,11 +240,12 @@ class RVC:
|
|||||||
self.next_index_ratio = modelSlot.defaultIndexRatio
|
self.next_index_ratio = modelSlot.defaultIndexRatio
|
||||||
self.next_samplingRate = modelSlot.samplingRate
|
self.next_samplingRate = modelSlot.samplingRate
|
||||||
self.next_framework = "ONNX" if modelSlot.isONNX else "PyTorch"
|
self.next_framework = "ONNX" if modelSlot.isONNX else "PyTorch"
|
||||||
self.needSwitch = True
|
# self.needSwitch = True
|
||||||
print("[Voice Changer] Prepare done.")
|
print("[Voice Changer] Prepare done.")
|
||||||
|
self.switchModel(slot)
|
||||||
return self.get_info()
|
return self.get_info()
|
||||||
|
|
||||||
def switchModel(self):
|
def switchModel(self, slot: int):
|
||||||
print("[Voice Changer] Switching model..")
|
print("[Voice Changer] Switching model..")
|
||||||
self.pipeline = self.next_pipeline
|
self.pipeline = self.next_pipeline
|
||||||
self.settings.tran = self.next_trans
|
self.settings.tran = self.next_trans
|
||||||
@ -254,6 +253,8 @@ class RVC:
|
|||||||
self.settings.modelSamplingRate = self.next_samplingRate
|
self.settings.modelSamplingRate = self.next_samplingRate
|
||||||
self.settings.framework = self.next_framework
|
self.settings.framework = self.next_framework
|
||||||
|
|
||||||
|
# self.currentSlot = self.settings.modelSlotIndex # prepareModelから呼ばれるということはupdate_settingsの中で呼ばれるということなので、まだmodelSlotIndexは更新されていない
|
||||||
|
self.currentSlot = slot
|
||||||
print(
|
print(
|
||||||
"[Voice Changer] Switching model..done",
|
"[Voice Changer] Switching model..done",
|
||||||
)
|
)
|
||||||
@ -308,13 +309,12 @@ class RVC:
|
|||||||
self.currentSlot,
|
self.currentSlot,
|
||||||
)
|
)
|
||||||
raise NoModeLoadedException("model_common")
|
raise NoModeLoadedException("model_common")
|
||||||
if self.needSwitch:
|
# if self.needSwitch:
|
||||||
print(
|
# print(
|
||||||
f"[Voice Changer] Switch model {self.currentSlot} -> {self.settings.modelSlotIndex}"
|
# f"[Voice Changer] Switch model {self.currentSlot} -> {self.settings.modelSlotIndex}"
|
||||||
)
|
# )
|
||||||
self.currentSlot = self.settings.modelSlotIndex
|
# self.switchModel()
|
||||||
self.switchModel()
|
# self.needSwitch = False
|
||||||
self.needSwitch = False
|
|
||||||
|
|
||||||
half = self.deviceManager.halfPrecisionAvailable(self.settings.gpu)
|
half = self.deviceManager.halfPrecisionAvailable(self.settings.gpu)
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ class RVC:
|
|||||||
f0_up_key = self.settings.tran
|
f0_up_key = self.settings.tran
|
||||||
index_rate = self.settings.indexRatio
|
index_rate = self.settings.indexRatio
|
||||||
if_f0 = 1 if self.settings.modelSlots[self.currentSlot].f0 else 0
|
if_f0 = 1 if self.settings.modelSlots[self.currentSlot].f0 else 0
|
||||||
embOutputLayer = self.settings.modelSlots[self.currentSlot].embOutputLayter
|
embOutputLayer = self.settings.modelSlots[self.currentSlot].embOutputLayer
|
||||||
useFinalProj = self.settings.modelSlots[self.currentSlot].useFinalProj
|
useFinalProj = self.settings.modelSlots[self.currentSlot].useFinalProj
|
||||||
|
|
||||||
audio_out = self.pipeline.exec(
|
audio_out = self.pipeline.exec(
|
||||||
|
@ -16,10 +16,10 @@ def checkRvcModelExist(model_dir: str):
|
|||||||
|
|
||||||
def downloadInitialSampleModels(sampleJsons: list[str], model_dir: str):
|
def downloadInitialSampleModels(sampleJsons: list[str], model_dir: str):
|
||||||
sampleModelIds = [
|
sampleModelIds = [
|
||||||
"KikotoMahiro",
|
"KikotoMahiro_o",
|
||||||
"TokinaShigure",
|
"TokinaShigure_o",
|
||||||
"Amitaro",
|
"Amitaro_o",
|
||||||
"Tsukuyomi-chan",
|
"Tsukuyomi-chan_o",
|
||||||
]
|
]
|
||||||
sampleModels = getModelSamples(sampleJsons, "RVC")
|
sampleModels = getModelSamples(sampleJsons, "RVC")
|
||||||
if sampleModels is None:
|
if sampleModels is None:
|
||||||
@ -60,23 +60,7 @@ def downloadInitialSampleModels(sampleJsons: list[str], model_dir: str):
|
|||||||
"position": line_num,
|
"position": line_num,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
sampleParams["files"]["rvcIndex"] = modelFilePath
|
sampleParams["files"]["rvcIndex"] = indexPath
|
||||||
line_num += 1
|
|
||||||
|
|
||||||
featurePath = None
|
|
||||||
if hasattr(sample, "featureUrl") or sample.featureUrl != "":
|
|
||||||
featurePath = os.path.join(
|
|
||||||
slotDir,
|
|
||||||
os.path.basename(sample.featureUrl),
|
|
||||||
)
|
|
||||||
downloadParams.append(
|
|
||||||
{
|
|
||||||
"url": sample.featureUrl,
|
|
||||||
"saveTo": featurePath,
|
|
||||||
"position": line_num,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
sampleParams["files"]["rvcFeatur"] = modelFilePath
|
|
||||||
line_num += 1
|
line_num += 1
|
||||||
|
|
||||||
sampleParams["sampleId"] = sample.id
|
sampleParams["sampleId"] = sample.id
|
||||||
@ -123,19 +107,8 @@ def downloadModelFiles(sampleInfo: RVCModelSample):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
featurePath = None
|
|
||||||
if hasattr(sampleInfo, "featureUrl") or sampleInfo.featureUrl != "":
|
|
||||||
featurePath = os.path.join(TMP_DIR, os.path.basename(sampleInfo.featureUrl))
|
|
||||||
downloadParams.append(
|
|
||||||
{
|
|
||||||
"url": sampleInfo.featureUrl,
|
|
||||||
"saveTo": featurePath,
|
|
||||||
"position": 2,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
print("[Voice Changer] Downloading model files...", end="")
|
print("[Voice Changer] Downloading model files...", end="")
|
||||||
with ThreadPoolExecutor() as pool:
|
with ThreadPoolExecutor() as pool:
|
||||||
pool.map(download_no_tqdm, downloadParams)
|
pool.map(download_no_tqdm, downloadParams)
|
||||||
print("")
|
print("")
|
||||||
return modelPath, indexPath, featurePath
|
return modelPath, indexPath
|
||||||
|
@ -64,5 +64,10 @@ def merge_model(request: MergeModelRequest):
|
|||||||
merged["embedder_name"] = (
|
merged["embedder_name"] = (
|
||||||
state_dict["embedder_name"] if "embedder_name" in state_dict else None
|
state_dict["embedder_name"] if "embedder_name" in state_dict else None
|
||||||
)
|
)
|
||||||
|
merged["embedder_output_layer"] = (
|
||||||
|
state_dict["embedder_output_layer"]
|
||||||
|
if "embedder_output_layer" in state_dict
|
||||||
|
else None
|
||||||
|
)
|
||||||
print("write metadata done.")
|
print("write metadata done.")
|
||||||
return merged
|
return merged
|
||||||
|
@ -45,6 +45,8 @@ def export2onnx(gpu: int, modelSlot: ModelSlot):
|
|||||||
"embChannels": modelSlot.embChannels,
|
"embChannels": modelSlot.embChannels,
|
||||||
# ↓EnumEmbedderTypesのままだとシリアライズできないのでテキスト化
|
# ↓EnumEmbedderTypesのままだとシリアライズできないのでテキスト化
|
||||||
"embedder": modelSlot.embedder.value,
|
"embedder": modelSlot.embedder.value,
|
||||||
|
"embOutputLayer": modelSlot.embOutputLayer,
|
||||||
|
"useFinalProj": modelSlot.useFinalProj,
|
||||||
}
|
}
|
||||||
gpuMomory = DeviceManager.get_instance().getDeviceMemory(gpu)
|
gpuMomory = DeviceManager.get_instance().getDeviceMemory(gpu)
|
||||||
print(f"[Voice Changer] exporting onnx... gpu_id:{gpu} gpu_mem:{gpuMomory}")
|
print(f"[Voice Changer] exporting onnx... gpu_id:{gpu} gpu_mem:{gpuMomory}")
|
||||||
|
@ -74,6 +74,7 @@ def _loadIndex(modelSlot: ModelSlot):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
print("Try loading...", modelSlot.indexFile)
|
||||||
index = faiss.read_index(modelSlot.indexFile)
|
index = faiss.read_index(modelSlot.indexFile)
|
||||||
except:
|
except:
|
||||||
print("[Voice Changer] load index failed. Use no index.")
|
print("[Voice Changer] load index failed. Use no index.")
|
||||||
|
Loading…
Reference in New Issue
Block a user