Skip to content

Commit

Permalink
Use optimize_for_inference
Browse files Browse the repository at this point in the history
  • Loading branch information
deiteris committed Jun 8, 2024
1 parent 5b1b0e1 commit 466eb98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/voice_changer/RVC/inferencer/RVCInferencerv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion server/voice_changer/RVC/inferencer/RVCInferencerv2Nono.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion server/voice_changer/common/rmvpe/rmvpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 466eb98

Please sign in to comment.