Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion extract_f0_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ def compute_f0(self, path, f0_method, crepe_hop_length):
from rmvpe import RMVPE

print("loading rmvpe model")
self.model_rmvpe = RMVPE("rmvpe.pt", is_half=False, device="cuda:0")
_dev = "cuda:0" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
self.model_rmvpe = RMVPE("rmvpe.pt", is_half=False, device=_dev)
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
elif f0_method == "dio":
f0, t = pyworld.dio(
Expand Down
8 changes: 8 additions & 0 deletions extract_feature_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
os.environ["CUDA_VISIBLE_DEVICES"] = str(i_gpu)
version = sys.argv[6]
import torch
# Patch torch.load for PyTorch 2.6+ (fairseq calls it with weights_only=True by default)
_orig_torch_load = torch.load
def _patched_torch_load(*args, **kwargs):
if "weights_only" not in kwargs:
kwargs["weights_only"] = False
return _orig_torch_load(*args, **kwargs)
torch.load = _patched_torch_load

import torch.nn.functional as F
import soundfile as sf
import numpy as np
Expand Down