|
Ran
|
Jobs
1
|
Files
11
|
Run time
1min
|
Badge
README BADGES
|
push
github
refactor: drop onnx-clip, load CLIP ONNX directly from HuggingFace (#3) * refactor: drop onnx-clip, load CLIP ONNX directly from HuggingFace The onnx-clip package downloaded its ONNX checkpoint from an S3 bucket that has since expired, breaking startup. Replace it with direct loading from openai/clip-vit-base-patch32 on HuggingFace Hub, pinned to commit 12b36594d. - pyproject.toml: drop onnx-clip; add onnxruntime, huggingface-hub, tokenizers, pillow, numpy as direct dependencies. - src/services/clip_service.py: rewrite to use onnxruntime.InferenceSession on the combined model.onnx (reads logits_per_image directly), with CLIP-specific image preprocessing (bicubic shorter-side resize + center crop + CLIP mean/std) and the standalone tokenizers library for prompts. Public API (CLIPService.__init__/decode_image/classify) and HTTP /classify/batch shape are unchanged. - src/config.py: add CLIP_MODEL_REPO, CLIP_MODEL_REVISION, CLIP_ONNX_FILENAME, CLIP_TOKENIZER_FILENAME knobs. - Dockerfile, Dockerfile.gpu: pre-pull the ONNX and tokenizer into HF_HOME=/app/.hf_cache at build time and set HF_HUB_OFFLINE=1 at runtime, so the service never reaches the network at startup. - CLAUDE.md: refresh architecture description + config table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(clip): restore batch_size chunking + clarify HF cache constraint Review noted that the rewrite silently dropped the chunking semantics of OnnxClip(batch_size=...) — all images were run in a single session.run, which spikes GPU/CPU memory at CLIP_MAX_BATCH_SIZE=64. Restore the original behavior: classify() now loops session.run over image chunks of size batch_size, concatenates the per-chunk logits_per_image, then applies softmax. Verified that chunked and single-shot results match exactly (7 images at batch_size=3 → 3 session.run calls → identical probabilities to a 1-image call). Also clarify in CLAUDE.m... (continued)
16 of 51 new or added lines in 2 files covered. (31.37%)
1 existing line in 1 file now uncovered.181 of 231 relevant lines covered (78.35%)
0.78 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 35 |
41.18 |
-21.79% | src/services/clip_service.py |
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
41.18 |
-21.79% | src/services/clip_service.py |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 26038482344.1 | 11 |
78.35 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|