mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 21:45:00 +03:00
improve half precision check, and fallback(exp.)
This commit is contained in:
parent
28fa21a6b4
commit
9d6ae2fe2e
@ -377,16 +377,18 @@ class RVC:
|
||||
repeat,
|
||||
protect,
|
||||
)
|
||||
except DeviceCannotSupportHalfPrecisionException:
|
||||
result = audio_out.detach().cpu().numpy() * np.sqrt(vol)
|
||||
|
||||
return result
|
||||
except DeviceCannotSupportHalfPrecisionException as e:
|
||||
print(
|
||||
"[Device Manager] Device cannot support half precision. Fallback to float...."
|
||||
)
|
||||
self.deviceManager.setForceTensor(True)
|
||||
self.prepareModel(self.settings.modelSlotIndex)
|
||||
raise e
|
||||
|
||||
result = audio_out.detach().cpu().numpy() * np.sqrt(vol)
|
||||
|
||||
return result
|
||||
return
|
||||
|
||||
def __del__(self):
|
||||
del self.pipeline
|
||||
|
@ -17,6 +17,7 @@ from voice_changer.utils.LoadModelParams import LoadModelParams
|
||||
from voice_changer.utils.Timer import Timer
|
||||
from voice_changer.utils.VoiceChangerModel import VoiceChangerModel, AudioInOut
|
||||
from Exceptions import (
|
||||
DeviceCannotSupportHalfPrecisionException,
|
||||
DeviceChangingException,
|
||||
HalfPrecisionChangingException,
|
||||
NoModeLoadedException,
|
||||
@ -580,6 +581,9 @@ class VoiceChanger:
|
||||
"[Voice Changer] Voice Changer is not selected. Wait a bit and if there is no improvement, please re-select vc."
|
||||
)
|
||||
return np.zeros(1).astype(np.int16), [0, 0, 0]
|
||||
except DeviceCannotSupportHalfPrecisionException:
|
||||
# RVC.pyでfallback処理をするので、ここはダミーデータ返すだけ。
|
||||
return np.zeros(1).astype(np.int16), [0, 0, 0]
|
||||
except Exception as e:
|
||||
print("[Voice Changer] VC PROCESSING EXCEPTION!!!", e)
|
||||
print(traceback.format_exc())
|
||||
|
Loading…
Reference in New Issue
Block a user