1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-08 03:55:47 +08:00

optimize(infer): move jit into rvc

This commit is contained in:
源文雨
2024-06-14 22:44:07 +09:00
parent e936e24a91
commit c51a73f521
8 changed files with 143 additions and 229 deletions

13
rvc/f0/models.py Normal file
View File

@@ -0,0 +1,13 @@
import torch
def get_rmvpe(model_path="assets/rmvpe/rmvpe.pt", device=torch.device("cpu"), is_half=False):
from rvc.f0.e2e import E2E
model = E2E(4, 1, (2, 2))
ckpt = torch.load(model_path, map_location=device)
model.load_state_dict(ckpt)
model.eval()
if is_half:
model = model.half()
model = model.to(device)
return model