• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

galthran-wq / clip-web-service / 26038482344
78%

Build:
DEFAULT BRANCH: master
Ran 18 May 2026 02:04PM UTC
Jobs 1
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 May 2026 02:03PM UTC coverage: 78.355% (-10.9%) from 89.247%
26038482344

push

github

web-flow
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

Uncovered Changes

Lines Coverage ∆ File
35
41.18
-21.79% src/services/clip_service.py

Coverage Regressions

Lines Coverage ∆ File
1
41.18
-21.79% src/services/clip_service.py
Jobs
ID Job ID Ran Files Coverage
1 26038482344.1 18 May 2026 02:04PM UTC 11
78.35
GitHub Action Run
Source Files on build 26038482344
  • Tree
  • List 11
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26038482344
  • 5d2bf8a9 on github
  • Prev Build on master (#23587672099)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc