From e1be6c799172d215e913422ead9c229ed1fde6dc Mon Sep 17 00:00:00 2001 From: Sleeps Date: Wed, 7 Oct 2026 13:23:44 +0100 Subject: [PATCH] Add global specialist caption override --- scene_search/caption_jobs.py | 37 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/scene_search/caption_jobs.py b/scene_search/caption_jobs.py index 81e0b30..cd01b5c 100644 --- a/scene_search/caption_jobs.py +++ b/scene_search/caption_jobs.py @@ -212,20 +212,29 @@ class CaptionJobManager: try: self._progress({"stage": "routing"}) - # The router uses the local GPU. Block SigLIP searches/indexing only - # for this stage; the actual VLM caption requests run on Ollama. - self._set_gpu_busy(True) - try: - with self.search_service.model_lock: - with FrameSource() as frame_source: - routed, missing = _route_rows( - rows, - progress=self._progress, - frame_source=frame_source, - before_batch=lambda: self._wait_if_paused("routing"), - ) - finally: - self._set_gpu_busy(False) + # The normal router uses the local GPU. A global specialist + # override has no classifier work, so do not block semantic search. + if settings.caption_force_specialist: + with FrameSource() as frame_source: + routed, missing = _route_rows( + rows, + progress=self._progress, + frame_source=frame_source, + before_batch=lambda: self._wait_if_paused("routing"), + ) + else: + self._set_gpu_busy(True) + try: + with self.search_service.model_lock: + with FrameSource() as frame_source: + routed, missing = _route_rows( + rows, + progress=self._progress, + frame_source=frame_source, + before_batch=lambda: self._wait_if_paused("routing"), + ) + finally: + self._set_gpu_busy(False) if not routed: self._progress(