mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-13 00:26:42 +03:00
set up model runner on thread start to avoid unpickling error
This commit is contained in:
parent
195eeff466
commit
f6ea31cb7c
@ -95,6 +95,12 @@ class AudioProcessor(FrigateProcess):
|
|||||||
self.cameras = cameras
|
self.cameras = cameras
|
||||||
self.config = config
|
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:
|
if self.config.audio_transcription.enabled:
|
||||||
self.transcription_model_runner = AudioTranscriptionModelRunner(
|
self.transcription_model_runner = AudioTranscriptionModelRunner(
|
||||||
self.config.audio_transcription.device,
|
self.config.audio_transcription.device,
|
||||||
@ -103,12 +109,6 @@ class AudioProcessor(FrigateProcess):
|
|||||||
else:
|
else:
|
||||||
self.transcription_model_runner = None
|
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:
|
if len(self.cameras) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ class AudioEventMaintainer(threading.Thread):
|
|||||||
)
|
)
|
||||||
self.detection_publisher = DetectionPublisher(DetectionTypeEnum.audio.value)
|
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
|
# init the transcription processor for this camera
|
||||||
self.transcription_processor = AudioTranscriptionRealTimeProcessor(
|
self.transcription_processor = AudioTranscriptionRealTimeProcessor(
|
||||||
config=self.config,
|
config=self.config,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user