Files
KohakuHub/scripts/dev
narugo1992 624d390ffe seed(pr77): demo repos that collide on path with HF, structurally different
Adds ``scripts/dev/seed_pr77_demo.py`` — an idempotent secondary
seed run after ``make seed-demo`` that creates a small set of
local repos whose ``(namespace, name)`` collides with real
HuggingFace repos but whose content is intentionally structurally
different. Together they let any reviewer hit a few
``huggingface_hub`` calls and watch the strict-consistency
contract behave as expected on a single-HF-fallback dev backend.

Three repos:

  - ``openai-community/gpt2``  — README.md only.
  - ``bigscience/bloom``       — README.md + a small text note.
  - ``narugo1992-pr77-demo/guide`` — README.md only; documents
    the genuine-pure-fallback path (no local collision).

Each repo's ``README.md`` is the verification guide for that
contract: it explains what the repo is for, lists the exact
``HfApi`` / ``hf_hub_download`` calls to drive against the dev
backend, and states what the response should look like on this PR
versus the pre-fix counterfactual. Where applicable, also includes
a wire-level ``curl -i`` against the resolve URL to inspect the
response headers (X-Error-Code / X-Source / X-Source-Count) — the
absence of X-Source* headers is the proof that the fallback chain
did not run when it shouldn't have.

The script is idempotent against itself: re-running it logs
``[=]`` for the entries already present and exits without touching
anything. Default credentials are the seed's ``mai_lin`` account.
Targets ``http://127.0.0.1:48888`` and the dev admin token by
default; override the constants at the top of the script for
non-dev backends.

Why no Makefile target: the existing ``make seed-demo`` shouldn't
be cluttered with PR-specific demos; running this script
explicitly keeps the seed surface minimal. The script's docstring
documents the one-line invocation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:48:41 +08:00
..
2026-04-21 12:50:30 +08:00