From c08426ac51af0f582719f2356c91301fd829f574 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:57:55 +0800 Subject: [PATCH] chore(sync): merge dev into main (#1408) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update mdxnet.py * Update modules.py * Rename preprocess.py to vr.py * Add files via upload * deps: add av lib (#1391) * Add files via upload * chore(format): run black on dev (#1398) Co-authored-by: github-actions[bot] * chore: sync dev to mian (#1404) * Add files via upload * Update rvc_for_realtime.py * Add files via upload * Add files via upload * chore(format): run black on dev (#1407) Co-authored-by: github-actions[bot] --------- Co-authored-by: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Co-authored-by: Hiroto N Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com> --- infer-web.py | 15 +++------------ infer/lib/infer_pack/models.py | 2 +- infer/modules/vc/pipeline.py | 6 +++--- tools/rvc_for_realtime.py | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/infer-web.py b/infer-web.py index 57c8845..3759d52 100644 --- a/infer-web.py +++ b/infer-web.py @@ -16,16 +16,6 @@ from configs.config import Config from sklearn.cluster import MiniBatchKMeans from dotenv import load_dotenv import torch - -try: - import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import - - if torch.xpu.is_available(): - from infer.modules.ipex import ipex_init - - ipex_init() -except Exception: # pylint: disable=broad-exception-caught - pass import numpy as np import gradio as gr import faiss @@ -449,7 +439,8 @@ def change_f0(if_f0_3, sr2, version19): # f0method8,pretrained_G14,pretrained_D path_str = "" if version19 == "v1" else "_v2" return ( {"visible": if_f0_3, "__type__": "update"}, - *get_pretrained_models(path_str, "f0", sr2), + {"visible": if_f0_3, "__type__": "update"}, + *get_pretrained_models(path_str, "f0" if if_f0_3 == True else "", sr2), ) @@ -1291,7 +1282,7 @@ with gr.Blocks(title="RVC WebUI") as app: if_f0_3.change( change_f0, [if_f0_3, sr2, version19], - [f0method8, pretrained_G14, pretrained_D15], + [f0method8, gpus_rmvpe, pretrained_G14, pretrained_D15], ) gpus16 = gr.Textbox( label=i18n("以-分隔输入使用的卡号, 例如 0-1-2 使用卡0和卡1和卡2"), diff --git a/infer/lib/infer_pack/models.py b/infer/lib/infer_pack/models.py index a60ced6..1d43061 100644 --- a/infer/lib/infer_pack/models.py +++ b/infer/lib/infer_pack/models.py @@ -1125,7 +1125,7 @@ class SynthesizerTrnMs768NSFsid_nono(nn.Module): sr=None, **kwargs ): - super(self, SynthesizerTrnMs768NSFsid_nono).__init__() + super(SynthesizerTrnMs768NSFsid_nono, self).__init__() self.spec_channels = spec_channels self.inter_channels = inter_channels self.hidden_channels = hidden_channels diff --git a/infer/modules/vc/pipeline.py b/infer/modules/vc/pipeline.py index 0c22584..9e3e387 100644 --- a/infer/modules/vc/pipeline.py +++ b/infer/modules/vc/pipeline.py @@ -321,14 +321,14 @@ class Pipeline(object): if audio_pad.shape[0] > self.t_max: audio_sum = np.zeros_like(audio) for i in range(self.window): - audio_sum += audio_pad[i : i - self.window] + audio_sum += np.abs(audio_pad[i : i - self.window]) for t in range(self.t_center, audio.shape[0], self.t_center): opt_ts.append( t - self.t_query + np.where( - np.abs(audio_sum[t - self.t_query : t + self.t_query]) - == np.abs(audio_sum[t - self.t_query : t + self.t_query]).min() + audio_sum[t - self.t_query : t + self.t_query] + == audio_sum[t - self.t_query : t + self.t_query].min() )[0][0] ) s = 0 diff --git a/tools/rvc_for_realtime.py b/tools/rvc_for_realtime.py index 378c40b..e71c3f2 100644 --- a/tools/rvc_for_realtime.py +++ b/tools/rvc_for_realtime.py @@ -373,7 +373,7 @@ class RVC: else: printt("Index search FAILED or disabled") except: - traceback.printt_exc() + traceback.print_exc() printt("Index search FAILED") feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1) t3 = ttime()