mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-02 16:23:58 +03:00
update
This commit is contained in:
parent
3e78db4318
commit
38d7ec8c4f
@ -119,11 +119,11 @@ class DiffusionSVCInferencer(Inferencer):
|
||||
|
||||
# print("[ ----Timer::1: ]", t.secs)
|
||||
|
||||
with Timer("pre-process", True) as t:
|
||||
with Timer("pre-process", False) as t:
|
||||
if skip_diffusion == 0:
|
||||
out_mel = self.__call__(feats, pitch, volume, spk_id=sid, spk_mix_dict=None, aug_shift=0, gt_spec=gt_spec, infer_speedup=infer_speedup, method='dpm-solver', k_step=k_step, use_tqdm=False, spk_emb=None)
|
||||
gt_spec = out_mel
|
||||
print("[ ----Timer::2: ]", t.secs)
|
||||
# print("[ ----Timer::2: ]", t.secs)
|
||||
|
||||
|
||||
with Timer("pre-process", False) as t: # NOQA
|
||||
@ -133,6 +133,7 @@ class DiffusionSVCInferencer(Inferencer):
|
||||
out_wav *= mask
|
||||
else:
|
||||
out_wav = self.vocoder_onnx.infer(gt_spec, pitch, silence_front, mask)
|
||||
# out_wav = self.vocoder_onnx.infer(gt_spec, pitch, 0, mask)
|
||||
# print("[ ----Timer::3: ]", t.secs)
|
||||
|
||||
return out_wav.squeeze()
|
||||
|
@ -99,7 +99,8 @@ class Pipeline(object):
|
||||
silence_front,
|
||||
embOutputLayer,
|
||||
useFinalProj,
|
||||
protect=0.5
|
||||
protect=0.5,
|
||||
skip_diffusion=True,
|
||||
):
|
||||
# print("---------- pipe line --------------------")
|
||||
with Timer("pre-process", False) as t:
|
||||
@ -174,7 +175,8 @@ class Pipeline(object):
|
||||
sid,
|
||||
k_step,
|
||||
infer_speedup,
|
||||
silence_front=silence_front
|
||||
silence_front=silence_front,
|
||||
skip_diffusion=skip_diffusion
|
||||
).to(dtype=torch.float32),
|
||||
-1.0,
|
||||
1.0,
|
||||
|
@ -145,18 +145,20 @@ class Pipeline(object):
|
||||
feats = feats.view(1, -1)
|
||||
|
||||
# embedding
|
||||
with autocast(enabled=self.isHalf):
|
||||
try:
|
||||
feats = self.embedder.extractFeatures(feats, embOutputLayer, useFinalProj)
|
||||
if torch.isnan(feats).all():
|
||||
raise DeviceCannotSupportHalfPrecisionException()
|
||||
except RuntimeError as e:
|
||||
if "HALF" in e.__str__().upper():
|
||||
raise HalfPrecisionChangingException()
|
||||
elif "same device" in e.__str__():
|
||||
raise DeviceChangingException()
|
||||
else:
|
||||
raise e
|
||||
with Timer("main-process", False) as te:
|
||||
with autocast(enabled=self.isHalf):
|
||||
try:
|
||||
feats = self.embedder.extractFeatures(feats, embOutputLayer, useFinalProj)
|
||||
if torch.isnan(feats).all():
|
||||
raise DeviceCannotSupportHalfPrecisionException()
|
||||
except RuntimeError as e:
|
||||
if "HALF" in e.__str__().upper():
|
||||
raise HalfPrecisionChangingException()
|
||||
elif "same device" in e.__str__():
|
||||
raise DeviceChangingException()
|
||||
else:
|
||||
raise e
|
||||
# print(f"[Embedding] {te.secs}")
|
||||
|
||||
# Index - feature抽出
|
||||
# if self.index is not None and self.feature is not None and index_rate != 0:
|
||||
|
Loading…
Reference in New Issue
Block a user