Add global specialist caption override

This commit is contained in:
Sleeps
2026-10-07 13:23:44 +01:00
parent b881754396
commit e1be6c7991
+23 -14
View File
@@ -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(