feat(fc2b): importer enqueues tag_and_embed + ml-worker model self-heal

import_media_file now enqueues tag_and_embed alongside generate_thumbnail
after a successful import. scripts/download_models.py snapshots Camie +
SigLIP into /models, idempotent (skips when present). The ml-worker
entrypoint runs it before starting the Celery worker so a fresh /models
volume self-heals on first boot. Downloader tests are pure-logic (no
network in CI).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-15 07:45:09 -04:00
parent bb48845268
commit b68a382b60
5 changed files with 104 additions and 1 deletions
+3 -1
View File
@@ -95,11 +95,13 @@ def import_media_file(self, import_task_id: int) -> dict:
session.add(task)
session.commit()
# Enqueue the thumbnail task for newly imported images.
# Enqueue the thumbnail + ML tasks for newly imported images.
if result.status == "imported" and result.image_id is not None:
from .ml import tag_and_embed
from .thumbnail import generate_thumbnail
generate_thumbnail.delay(result.image_id)
tag_and_embed.delay(result.image_id)
# If this was the last task in the batch, mark the batch complete.
remaining = session.execute(