mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-13 14:45:25 +03:00
Conditionally create embeddings
This commit is contained in:
parent
53ac3b37c2
commit
7cecfd73ef
@ -321,6 +321,10 @@ class FrigateApp:
|
|||||||
logger.info(f"Review process started: {review_segment_process.pid}")
|
logger.info(f"Review process started: {review_segment_process.pid}")
|
||||||
|
|
||||||
def init_embeddings_manager(self) -> None:
|
def init_embeddings_manager(self) -> None:
|
||||||
|
if not self.config.semantic_search.enabled:
|
||||||
|
self.embeddings = None
|
||||||
|
return
|
||||||
|
|
||||||
# Create a client for other processes to use
|
# Create a client for other processes to use
|
||||||
self.embeddings = EmbeddingsContext()
|
self.embeddings = EmbeddingsContext()
|
||||||
embedding_process = mp.Process(
|
embedding_process = mp.Process(
|
||||||
@ -816,7 +820,8 @@ class FrigateApp:
|
|||||||
self.db.stop()
|
self.db.stop()
|
||||||
|
|
||||||
# Save embeddings stats to disk
|
# Save embeddings stats to disk
|
||||||
self.embeddings.save_stats()
|
if self.embeddings:
|
||||||
|
self.embeddings.save_stats()
|
||||||
|
|
||||||
# Stop Communicators
|
# Stop Communicators
|
||||||
self.inter_process_communicator.stop()
|
self.inter_process_communicator.stop()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user