some bugfix and improve message

This commit is contained in:
wataru 2023-04-23 05:09:19 +09:00
parent eba6e6aeda
commit ef025efd30
6 changed files with 1669 additions and 38 deletions

View File

@ -1 +1,10 @@
<!doctype html><html style="width:100%;height:100%;overflow:hidden"><head><meta charset="utf-8"/><title>Voice Changer Client Demo</title><script defer="defer" src="index.js"></script></head><body style="width:100%;height:100%;margin:0"><div id="app" style="width:100%;height:100%"></div></body></html>
<!DOCTYPE html>
<html style="width: 100%; height: 100%; overflow: hidden">
<head>
<meta charset="utf-8" />
<title>Voice Changer Client Demo</title>
<script defer src="index.js"></script></head>
<body style="width: 100%; height: 100%; margin: 0px">
<div id="app" style="width: 100%; height: 100%"></div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,31 +0,0 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

View File

@ -53,7 +53,7 @@ export const ModelUploaderRow = (props: ModelUploaderRowProps) => {
</div>
</div>
</div>
<ModelSlotRow />
{props.showModelSlot ? <ModelSlotRow /> : <></>}
{props.showConfig ? <ConfigSelectRow /> : <></>}
{props.showOnnx ? <ONNXSelectRow /> : <></>}
{props.showPyTorch && guiState.showPyTorchModelUpload ? <PyTorchSelectRow /> : <></>}

View File

@ -30,7 +30,7 @@ from const import HUBERT_ONNX_MODEL_PATH, TMP_DIR
import pyworld as pw
from voice_changer.RVC.custom_vc_infer_pipeline import VC
from infer_pack.models import SynthesizerTrnMs256NSFsid
from infer_pack.models import SynthesizerTrnMs256NSFsid, SynthesizerTrnMs256NSFsid_nono
from fairseq import checkpoint_utils
providers = ['OpenVINOExecutionProvider', "CUDAExecutionProvider", "DmlExecutionProvider", "CPUExecutionProvider"]
@ -151,7 +151,8 @@ class RVC:
if pyTorchModelFile != None and pyTorchModelFile != "":
cpt = torch.load(pyTorchModelFile, map_location="cpu")
self.settings.modelSamplingRate = cpt["config"][-1]
net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=self.is_half)
# net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=self.is_half)
net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
net_g.eval()
net_g.load_state_dict(cpt["weight"], strict=False)
if self.is_half:
@ -351,6 +352,10 @@ class RVC:
return result
def inference(self, data):
if hasattr(self, "slot") == False:
print("[Voice Changer] No model uploaded.")
raise NoModeLoadedException("model_common")
if self.currentSlot != self.slot:
self.currentSlot = self.slot
self.switchModel()

View File

@ -126,7 +126,8 @@ class VC(object):
p_len = torch.tensor([p_len], device=self.device).long()
with torch.no_grad():
audio1 = (net_g.infer(feats, p_len, pitch, pitchf, sid)[0][0, 0] * 32768).data.cpu().float().numpy().astype(np.int16)
# audio1 = (net_g.infer(feats, p_len, pitch, pitchf, sid)[0][0, 0] * 32768).data.cpu().float().numpy().astype(np.int16)
audio1 = (net_g.infer(feats, p_len, sid)[0][0, 0] * 32768).data.cpu().float().numpy().astype(np.int16)
del feats, p_len, padding_mask
torch.cuda.empty_cache()