diff --git a/openvoice/se_extractor.py b/openvoice/se_extractor.py index a41c2566..c3fa01ae 100644 --- a/openvoice/se_extractor.py +++ b/openvoice/se_extractor.py @@ -19,7 +19,10 @@ def split_audio_whisper(audio_path, audio_name, target_dir='processed'): global model if model is None: - model = WhisperModel(model_size, device="cuda", compute_type="float16") + if torch.cuda.is_available(): + model = WhisperModel(model_size, device="cuda", compute_type="float16") + else: + model = WhisperModel(model_size, device="cpu", compute_type="int8") audio = AudioSegment.from_file(audio_path) max_len = len(audio)