diff --git a/frigate/data_processing/common/audio_transcription/model.py b/frigate/data_processing/common/audio_transcription/model.py index 0fe5ddb5c..82472ad62 100644 --- a/frigate/data_processing/common/audio_transcription/model.py +++ b/frigate/data_processing/common/audio_transcription/model.py @@ -4,7 +4,6 @@ import logging import os import sherpa_onnx -from faster_whisper.utils import download_model from frigate.comms.inter_process import InterProcessRequestor from frigate.const import MODEL_CACHE_DIR @@ -25,6 +24,9 @@ class AudioTranscriptionModelRunner: if model_size == "large": # use the Whisper download function instead of our own + # Import dynamically to avoid crashes on systems without AVX support + from faster_whisper.utils import download_model + logger.debug("Downloading Whisper audio transcription model") download_model( size_or_id="small" if device == "cuda" else "tiny", diff --git a/frigate/data_processing/post/audio_transcription.py b/frigate/data_processing/post/audio_transcription.py index 066287707..870c34068 100644 --- a/frigate/data_processing/post/audio_transcription.py +++ b/frigate/data_processing/post/audio_transcription.py @@ -6,7 +6,6 @@ import threading import time from typing import Optional -from faster_whisper import WhisperModel from peewee import DoesNotExist from frigate.comms.inter_process import InterProcessRequestor @@ -51,6 +50,9 @@ class AudioTranscriptionPostProcessor(PostProcessorApi): def __build_recognizer(self) -> None: try: + # Import dynamically to avoid crashes on systems without AVX support + from faster_whisper import WhisperModel + self.recognizer = WhisperModel( model_size_or_path="small", device="cuda"