mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2024-12-29 19:15:04 +08:00
chore(sync): merge dev into main (#1408)
* 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] <github-actions[bot]@users.noreply.github.com> * 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] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Co-authored-by: Hiroto N <hironow365@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: 源文雨 <41315874+fumiama@users.noreply.github.com>
This commit is contained in:
parent
1696c5356b
commit
c08426ac51
15
infer-web.py
15
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"),
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user