Spaces:
Runtime error
Runtime error
Commit History
-
deploy-hf: try push first, create-Space on failure (stop spurious exit-22)
The deploy gated on `git ls-remote`; a transient blip wrongly took the "Space not found" branch and ran `curl -sf … repos/create` against the already-existing Space → HTTP 4xx → exit 22 → the whole deploy failed for no real reason (happened on the #17 merge). Now the force-push is attempted first (it's the real connectivity/auth test). Only if it fails do we create the Space best-effort (non-fatal, logs the HTTP code) and retry the push. No flaky ls-remote gate; a genuine auth failure still fails the step clearly on the retry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9e93c33
-
checkpoint-7: fix HF Gradio HfFolder import + bump checkout to Node 24
Two issues, one PR: 1. HF Space ImportError: cannot import name 'HfFolder' from 'huggingface_hub'. Gradio 4.44.0 references HfFolder which was removed in newer huggingface_hub. HF Spaces installs a recent huggingface_hub regardless, so the only safe fix is to bump Gradio to a line that no longer references it. Pinning gradio>=5,<6 and sdk_version=5.46.0 in the HF frontmatter. Our local Gradio is 6.14.0 with all 76 tests passing, so we know the demo code works on 5+. 2. GitHub Actions warning that actions/checkout@v4 (Node 20) is being sunset on 2026-06-06 in favour of Node 24. Bumped to @v5 which runs on Node 24. No code changes inside src/ccdp/.4750d58 -
checkpoint-6: pin HF Space python_version=3.11 + audioop-lts safety net
HF Space runtime error after checkpoint-5 merged: File "pydub/utils.py", line 14, in <module> import audioop ModuleNotFoundError: No module named 'audioop' Python 3.13 removed the deprecated `audioop` stdlib module. Gradio depends on pydub which still requires it. HF Spaces appears to have defaulted to Python 3.13 for our build (the `sdk_version: 4.44.0` field doesn't pin Python). Two-pronged fix: 1. **Pin python_version = "3.11" in the HF Space frontmatter.** Most reliable path: avoid 3.13 entirely. 3.11 is stable, has long-term wheels for our whole ML stack (torch, ultralytics, xgboost, scipy, pandas, ...). This is what production ML demos generally target. 2. **Add `audioop-lts; python_version >= "3.13"` to requirements.txt** as a backup. If the Space (or anyone else) ends up on 3.13 despite us asking for 3.11, the backport package satisfies pydub. Belt-and-suspenders. Proactive audit of all third-party imports on the HF Space code path (app.py → ccdp.…03b3c8c -
checkpoint-4: fix HF deploy + wire XGBoost bundles on the Space
Two related fixes: 1. **HF Space "Missing configuration in README" error.** The deploy workflow modified README.md in the runner's working tree to prepend HF's YAML frontmatter, but never committed the change. `git push` only carries committed history, so the Space received the unmodified GitHub README. Fix: commit the frontmatter prepend before pushing. 2. **XGBoost on the Space was falling through to Tier-3 fallback** because the v0.1.0 release shipped only `best.ubj` weights, not the matching `bundle.json` sidecars (column schema, training catalog id, etc.) that `BaseVariantPipeline._load_xgb_bundle` requires. - Uploaded `bundle_a.json` + `bundle_b.json` to the v0.1.0 release. - app.py now arranges each XGBoost asset inside a per-variant subdir (`checkpoints/production/xgb_a/{best.ubj,best.pt,bundle.json}`) and symlinks the top-level `xgb_a.pt` to it, mirroring the local registry layout that `production_target("xgb_a").resolve().parent` e…edeef37 -
checkpoint-3: comparison report, FastAPI, Gradio, HF Space deploy
Phase 3 brings the system to humans. Three deliverables, all reading from the existing v0.1.0 production registry — no new training, no model changes. ## New modules ccdp/preprocess (Stage A: deterministic downscale + quality report). - `normalize_for_inference` LANCZOS-resizes long edges to 1600 px max. - `quality_report` returns sharpness (Laplacian variance), brightness, contrast, low-resolution / low-light / blurry booleans. - Stage B (super-resolution) explicitly deferred to a later checkpoint. ccdp/eval — Variant A vs B head-to-head evaluator. - `metrics.py`: pure per-class P/R/F1 + regression metrics (no sklearn). - `comparison.py`: `build_comparison()` runs both pipelines on the seed=42 test split, returns a `Comparison` dataclass. - `report.py`: Jinja2 -> HTML always; WeasyPrint -> PDF when installed. - `reports/templates/report.html.j2`: A4-formatted report with headline table, per-variant detail, tier/latency, top failures, disclosures. ccdp/api…323fee6