refactor(ml): drop dead tagger/suggestion settings + columns (#1199)
Hygiene follow-up to the Camie retirement (#1189) — these were left inert to bound that change; nothing reads them now. Migration 0068 drops: - ml_settings: tagger_store_floor, tagger_model_version, suggestion_threshold_ character/general (already dead pre-retirement — scoring uses per-head thresholds), video_min_tag_frames (only the deleted video-prediction aggregator used it). - image_record: tagger_model_version (no writer), centroid_scores (dead JSON cache, no reader). Also: ml_admin _EDITABLE/GET/_validate pruned (dropped the store-floor invariant + video_min_tag_frames check); MLThresholdSliders trimmed to a video-embedding card (interval + max frames only); importer no longer resets the dropped cols; download_models drops the Camie fetch; stale CASCADE comments in cleanup_service no longer name the removed tables. Tests updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
This commit is contained in:
@@ -7,7 +7,6 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
MODEL_ROOT = Path(os.environ.get("ML_MODEL_DIR", "/models"))
|
||||
CAMIE_REPO = os.environ.get("CAMIE_HF_REPO", "Camais03/camie-tagger-v2")
|
||||
SIGLIP_REPO = os.environ.get(
|
||||
"SIGLIP_HF_REPO", "google/siglip-so400m-patch14-384"
|
||||
)
|
||||
@@ -24,34 +23,6 @@ def _snapshot(repo_id: str, dest: Path, allow_patterns: list[str] | None) -> Non
|
||||
)
|
||||
|
||||
|
||||
def ensure_camie() -> None:
|
||||
"""Fetch Camie v2 weights + metadata.
|
||||
|
||||
v2 layout (HuggingFace Camais03/camie-tagger-v2): the ONNX file is
|
||||
named camie-tagger-v2.onnx (not model.onnx) and tags ship inside
|
||||
camie-tagger-v2-metadata.json (not selected_tags.csv). Both at root.
|
||||
The repo also contains app/, game/, training/, images/ subdirs full
|
||||
of setup/demo files we don't need — allow_patterns scopes the fetch
|
||||
to just the inference essentials (~790 MB instead of ~2 GB).
|
||||
"""
|
||||
dest = MODEL_ROOT / "camie"
|
||||
model_file = dest / "camie-tagger-v2.onnx"
|
||||
meta_file = dest / "camie-tagger-v2-metadata.json"
|
||||
if model_file.is_file() and meta_file.is_file():
|
||||
print(f"[download_models] Camie present at {dest}")
|
||||
return
|
||||
print(f"[download_models] Fetching {CAMIE_REPO} -> {dest}")
|
||||
_snapshot(
|
||||
CAMIE_REPO, dest,
|
||||
[
|
||||
"camie-tagger-v2.onnx",
|
||||
"camie-tagger-v2-metadata.json",
|
||||
"config.json",
|
||||
"config.yaml",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
def ensure_siglip() -> None:
|
||||
dest = MODEL_ROOT / "siglip"
|
||||
if (dest / "config.json").is_file() and any(dest.glob("*.safetensors")):
|
||||
@@ -62,7 +33,6 @@ def ensure_siglip() -> None:
|
||||
|
||||
|
||||
def main() -> int:
|
||||
ensure_camie()
|
||||
ensure_siglip()
|
||||
print("[download_models] Done.")
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user