This commit is contained in:
wataru 2023-06-26 01:10:39 +09:00
parent 21b9a9fe24
commit d3c971e033

View File

@ -36,15 +36,13 @@ class RVCModelSlotGenerator(ModelSlotGenerator):
def _setInfoByPytorch(cls, slot: ModelSlot): def _setInfoByPytorch(cls, slot: ModelSlot):
cpt = torch.load(slot.modelFile, map_location="cpu") cpt = torch.load(slot.modelFile, map_location="cpu")
config_len = len(cpt["config"]) config_len = len(cpt["config"])
print(cpt["version"]) print(cpt["version"])
if cpt["version"] == "voras_beta": if cpt["version"] == "voras_beta":
slot.f0 = True if cpt["f0"] == 1 else False slot.f0 = True if cpt["f0"] == 1 else False
slot.modelType = EnumInferenceTypes.pyTorchVoRASbeta.value slot.modelType = EnumInferenceTypes.pyTorchVoRASbeta.value
slot.embChannels = 768 slot.embChannels = 768
slot.embOutputLayer = ( 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
)
slot.useFinalProj = False slot.useFinalProj = False
slot.embedder = cpt["embedder_name"] slot.embedder = cpt["embedder_name"]