Add FP32 ONNX photo classifier backend

This commit is contained in:
Victor Kuznetsov committed 2026-09-10 19:31:24 -07:00
1 parent d914e3ac08
commit 78426aeef7
20 files changed
+534 -142

No files matched your search

@@ -6,8 +6,9 @@ name: Publish photo classifier to Hugging Face
# Hub model: wiltodelta/raiw-photo-classify
# Secret: HF_TOKEN, write-role Hugging Face token (same secret Space sync uses).
#
# Weights are not in git. Full mode downloads them from a GitHub Release
# of this repository, then uploads with the card from docs/photo-classify-hf/.
# Weights are not in git. Full mode downloads the frozen PyTorch files from a
# GitHub Release, exports the vision-only ONNX graph, then uploads everything
# with the card from docs/photo-classify-hf/.
on:
workflow_dispatch:
@@ -52,6 +53,14 @@ jobs:
gh release download "$TAG" --repo "${{ github.repository }}" --dir weights
ls -l weights
- name: Export the vision-only ONNX graph
if: ${{ github.event.inputs.mode == 'full' }}
run: |
set -euo pipefail
uv run --extra classify --with onnx python scripts/export_photo_classify_onnx.py \
--checkpoint weights/clip-l-ft.pt \
--out weights/clip-l-ft-vision-fp32.onnx
- name: Publish to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}