Skip to content

Commit

Permalink
Update pipeline.py
Browse files Browse the repository at this point in the history
TheNeodev authored Dec 18, 2024
1 parent ff426fb commit 6963266
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions rvc_inferpy/pipeline.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import gc
import traceback
import logging

logger = logging.getLogger(__name__)

from functools import lru_cache
@@ -33,6 +33,16 @@
import torch
from rvc_inferpy.infer_list.rmvpe import RMVPE
from rvc_inferpy.infer_list.fcpe import FCPE
from rvc_inferpy.config_loader import *

validate_config_and_files()

BaseLoader(hubert_path=hubert_model_path, rmvpe_path=rmvpe_model_path)
rvcbasdl = lambda: print("RVC-based loader initialized.") # Replace with the actual function
rvcbasdl()





@lru_cache
@@ -256,11 +266,11 @@ def get_f0_pyin_computation(self, x, f0_min, f0_max):

def get_rmvpe(self, x, *args, **kwargs):
if not hasattr(self, "model_rmvpe"):
from lib.infer.infer_libs.rmvpe import RMVPE
from rvc_inferpy.infer_list.rmvpe import RMVPE

logger.info(f"Loading rmvpe model, {os.environ['rmvpe_model_path']}")
self.model_rmvpe = RMVPE(
os.environ["rmvpe_model_path"],
rmvpe_model_path,
is_half=self.is_half,
device=self.device,
)
@@ -275,11 +285,11 @@ def get_rmvpe(self, x, *args, **kwargs):

def get_pitch_dependant_rmvpe(self, x, f0_min=1, f0_max=40000, *args, **kwargs):
if not hasattr(self, "model_rmvpe"):
from lib.infer.infer_libs.rmvpe import RMVPE
from rvc_inferpy.infer_list.rmvpe import RMVPE

logger.info(f"Loading rmvpe model, {os.environ['rmvpe_model_path']}")
self.model_rmvpe = RMVPE(
os.environ["rmvpe_model_path"],
rmvpe_model_path,
is_half=self.is_half,
device=self.device,
)
@@ -295,7 +305,7 @@ def get_pitch_dependant_rmvpe(self, x, f0_min=1, f0_max=40000, *args, **kwargs):

def get_fcpe(self, x, f0_min, f0_max, p_len, *args, **kwargs):
self.model_fcpe = FCPE(
os.environ["fcpe_model_path"],
fcpe_model_path,
f0_min=f0_min,
f0_max=f0_max,
dtype=torch.float32,
@@ -525,11 +535,11 @@ def get_f0(
)
elif f0_method == "rmvpe":
if not hasattr(self, "model_rmvpe"):
from lib.infer.infer_libs.rmvpe import RMVPE
from rvc_inferpy.infer_list.rmvpe import RMVPE

logger.info(f"Loading rmvpe model, {os.environ['rmvpe_model_path']}")
self.model_rmvpe = RMVPE(
os.environ["rmvpe_model_path"],
rmvpe_model_path,
is_half=self.is_half,
device=self.device,
)

0 comments on commit 6963266

Please sign in to comment.