set up model runner on thread start to avoid unpickling error

This commit is contained in:
Josh Hawkins 2025-10-08 17:35:37 -05:00
parent 195eeff466
commit f6ea31cb7c

View File

@ -95,6 +95,12 @@ class AudioProcessor(FrigateProcess):
self.cameras = cameras
self.config = config
def run(self) -> None:
self.pre_run_setup(self.config.logger)
audio_threads: list[AudioEventMaintainer] = []
threading.current_thread().name = "process:audio_manager"
if self.config.audio_transcription.enabled:
self.transcription_model_runner = AudioTranscriptionModelRunner(
self.config.audio_transcription.device,
@ -103,12 +109,6 @@ class AudioProcessor(FrigateProcess):
else:
self.transcription_model_runner = None
def run(self) -> None:
self.pre_run_setup(self.config.logger)
audio_threads: list[AudioEventMaintainer] = []
threading.current_thread().name = "process:audio_manager"
if len(self.cameras) == 0:
return
@ -180,7 +180,7 @@ class AudioEventMaintainer(threading.Thread):
)
self.detection_publisher = DetectionPublisher(DetectionTypeEnum.audio.value)
if self.camera_config.audio_transcription.enabled_in_config:
if self.config.audio_transcription.enabled:
# init the transcription processor for this camera
self.transcription_processor = AudioTranscriptionRealTimeProcessor(
config=self.config,