1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 17:20:25 +08:00
Files
Retrieval-based-Voice-Conve…/rvc/f0/models.py
github-actions[bot] ed8a0c3e34 chore(format): run black on dev (#55)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-14 22:45:03 +09:00

17 lines
372 B
Python

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