From 6963266c1f16ffaab2bc2d8559e2e4c6b1bdcb3f Mon Sep 17 00:00:00 2001 From: Neo Date: Wed, 18 Dec 2024 16:54:28 +0700 Subject: [PATCH] Update pipeline.py --- rvc_inferpy/pipeline.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/rvc_inferpy/pipeline.py b/rvc_inferpy/pipeline.py index e1d4fd3..f4c2f2c 100644 --- a/rvc_inferpy/pipeline.py +++ b/rvc_inferpy/pipeline.py @@ -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, )