diff --git a/server/voice_changer/RVC/inferencer/RVCInferencerv2.py b/server/voice_changer/RVC/inferencer/RVCInferencerv2.py index 3391b90c2..9de9f1fd3 100644 --- a/server/voice_changer/RVC/inferencer/RVCInferencerv2.py +++ b/server/voice_changer/RVC/inferencer/RVCInferencerv2.py @@ -37,7 +37,7 @@ def loadModel(self, file: str, gpu: int): model = model.eval() self.use_jit = True else: - model = torch.jit.freeze(torch.jit.script(model.eval())) + model = torch.jit.optimize_for_inference(torch.jit.script(model.eval()), other_methods=['infer']) torch.jit.save(model, jit_file) self.use_jit = False else: diff --git a/server/voice_changer/RVC/inferencer/RVCInferencerv2Nono.py b/server/voice_changer/RVC/inferencer/RVCInferencerv2Nono.py index 075582f74..fe8c89350 100644 --- a/server/voice_changer/RVC/inferencer/RVCInferencerv2Nono.py +++ b/server/voice_changer/RVC/inferencer/RVCInferencerv2Nono.py @@ -37,7 +37,7 @@ def loadModel(self, file: str, gpu: int): model = model.eval() self.use_jit = True else: - model = torch.jit.freeze(torch.jit.script(model.eval())) + model = torch.jit.optimize_for_inference(torch.jit.script(model.eval()), other_methods=['infer']) torch.jit.save(model, jit_file) self.use_jit = False else: diff --git a/server/voice_changer/common/rmvpe/rmvpe.py b/server/voice_changer/common/rmvpe/rmvpe.py index d51f6e494..11b73f859 100644 --- a/server/voice_changer/common/rmvpe/rmvpe.py +++ b/server/voice_changer/common/rmvpe/rmvpe.py @@ -355,7 +355,7 @@ def __init__(self, model_path: str, is_half: bool, device: torch.device | str = model = model.eval() self.use_jit = True else: - model = torch.jit.freeze(torch.jit.script(model.eval())) + model = torch.jit.optimize_for_inference(torch.jit.script(model.eval())) torch.jit.save(model, jit_file) self.use_jit = False else: