From d5212fb1c2536528ce18d7d6dde7147d3779c231 Mon Sep 17 00:00:00 2001 From: Alexey Shmelev Date: Sat, 26 Oct 2024 08:52:10 -0400 Subject: [PATCH] Another performance improvement ~0.3sec/call --- rvc/infer/pipeline.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/rvc/infer/pipeline.py b/rvc/infer/pipeline.py index 76225540..eae96f2d 100644 --- a/rvc/infer/pipeline.py +++ b/rvc/infer/pipeline.py @@ -207,7 +207,11 @@ def __init__(self, tgt_sr, config): ] self.autotune = Autotune(self.ref_freqs) self.note_dict = self.autotune.note_dict - + self.model_rmvpe = RMVPE0Predictor( + os.path.join("rvc", "models", "predictors", "rmvpe.pt"), + is_half=self.is_half, + device=self.device, + ) def get_f0_crepe( self, x, @@ -291,11 +295,6 @@ def get_f0_hybrid( x, f0_min, f0_max, p_len, int(hop_length) ) elif method == "rmvpe": - self.model_rmvpe = RMVPE0Predictor( - os.path.join("rvc", "models", "predictors", "rmvpe.pt"), - is_half=self.is_half, - device=self.device, - ) f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03) f0 = f0[1:] elif method == "fcpe": @@ -356,11 +355,6 @@ def get_f0( x, self.f0_min, self.f0_max, p_len, int(hop_length), "tiny" ) elif f0_method == "rmvpe": - self.model_rmvpe = RMVPE0Predictor( - os.path.join("rvc", "models", "predictors", "rmvpe.pt"), - is_half=self.is_half, - device=self.device, - ) f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03) elif f0_method == "fcpe": self.model_fcpe = FCPEF0Predictor(