modification

This commit is contained in:
wataru 2023-05-28 22:08:10 +09:00
parent 4d6d5a27cb
commit 21f098e8ec
5 changed files with 8 additions and 8 deletions

View File

@ -331,8 +331,8 @@ class MMVCv15:
else:
audio = self._pyTorch_inference(data)
return audio
except onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument as e:
print(e)
except onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument as _e:
print(_e)
raise ONNXInputArgumentException()
def __del__(self):

View File

@ -52,6 +52,6 @@ class CrepePitchExtractor(PitchExtractor):
) + 1
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > 255] = 255
f0_coarse = np.rint(f0_mel).astype(np.int)
f0_coarse = np.rint(f0_mel).astype(int)
return f0_coarse, f0bak

View File

@ -37,6 +37,6 @@ class DioPitchExtractor(PitchExtractor):
) + 1
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > 255] = 255
f0_coarse = np.rint(f0_mel).astype(np.int)
f0_coarse = np.rint(f0_mel).astype(int)
return f0_coarse, f0bak

View File

@ -38,6 +38,6 @@ class HarvestPitchExtractor(PitchExtractor):
) + 1
f0_mel[f0_mel <= 1] = 1
f0_mel[f0_mel > 255] = 255
f0_coarse = np.rint(f0_mel).astype(np.int)
f0_coarse = np.rint(f0_mel).astype(int)
return f0_coarse, f0bak

View File

@ -98,7 +98,7 @@ class VoiceChangerSettings:
class VoiceChanger:
settings: VoiceChangerSettings
settings: VoiceChangerSettings = VoiceChangerSettings()
voiceChanger: VoiceChangerModel | None = None
ioRecorder: IORecorder
sola_buffer: AudioInOut
@ -352,7 +352,7 @@ class VoiceChanger:
def update_settings(self, key: str, val: Any):
if self.voiceChanger is None:
print("[Voice Changer] Voice Changer is not selected.")
return
return self.get_info()
if key in self.settings.intData:
setattr(self.settings, key, int(val))
@ -567,7 +567,7 @@ class VoiceChanger:
print("[Voice Changer] [Exception]", e)
return np.zeros(1).astype(np.int16), [0, 0, 0]
except ONNXInputArgumentException as e:
print("[Voice Changer] [Exception]", e)
print("[Voice Changer] [Exception] onnx are waiting valid input.", e)
return np.zeros(1).astype(np.int16), [0, 0, 0]
except HalfPrecisionChangingException as e:
print("[Voice Changer] Switching model configuration....", e)