Spaces:
Running on Zero
Running on Zero
Commit History
6 days ago
-
feat(models): let AMS_BOOTSTRAP_BUDGET_S override the bootstrap budget
Unverified signatureAn end-to-end failure simulation (import app with SPACE_ID set, network blocked, nothing cached) has to reach the fatal summary in seconds, not after the default 25 minutes, and the operator gets a knob for a slow day. startup() now takes its budget from AMS_BOOTSTRAP_BUDGET_S when it is a positive, finite number of seconds; anything else falls back to the default with one [ams] line saying so. An explicit budget_s argument still wins. The diagnostics block logs the effective budget, includes the variable on the env line, and prints the effective huggingface_hub HF_HUB_CACHE path there ("hub cache: <path>"), since HF_HUB_CACHE=<unset> alone reads as if the cache location were unknown.5993a93 -
test(models): keep hub tests out of ci and check the manifest against the hub
Unverified signatureCI runs `pytest -m "not gpu"`, which overrides addopts' "not network", so a network-marked test would have run there. Network tests now also skip unless AMS_NETWORK_TESTS=1 is set. A new opt-in test lists every manifest repo and every LoRA preset at its pinned 40-hex commit through the Hub tree API and checks that each path exists with exactly the listed size, so a typo or a wrong size in the manifest cannot reach a deploy (snapshot_download silently skips paths that match nothing).8a16fc6 -
feat(models): log filesystems, zerogpu factor and an audio self-test at startup
Unverified signatureQuestions the design review could not settle from outside have to be answered by the first deploy's log, so the startup [ams] block now also reports: - each probed path's filesystem type and mount point from /proc/mounts (is /tmp a tmpfs? do the roots share one disk?); - on Spaces, spaces.zero.config's duration_factor, which decides whether requested GPU seconds are multiplied by 1.5; - torch.version.cuda, only when torch is already imported; - whether vendor/ace-step/acestep/handler.py exists (submodule present); - on Spaces, an audio self-test in a subprocess with a 60 s timeout that imports torch, torchaudio and torchcodec, prints their versions and decodes a 0.1 s WAV through torchaudio.load. The fork swallows decode failures in Cover/Extend/Edit, and the Mac gate cannot exercise the Linux binaries and system FFmpeg. Every probe has its own guard, uid/gid stay numeric, and the block still cannot raise.2c7871d -
fix(models): retry downloads over ordered strategies within one startup budget
Unverified signatureDesign review found the per-root error rules unworkable on hub 0.36.2: every requests and Hub error is an OSError subclass, hf_xet also raises RuntimeError and ValueError, and hf_transfer raises RuntimeError, so the exception type cannot tell a broken cache root from a network blip, and hopping roots that share one xet cache never reached the xet-off attempt. Downloads now walk a fixed strategy list: (hub cache, xet on), (hub cache, xet off), (app root, xet on), (app root, xet off). Any Exception moves on to the next strategy; PermissionError and EACCES/EPERM/EROFS/ ENOSPC/EDQUOT retire that root; RepositoryNotFound, RevisionNotFound, GatedRepo and HTTP 401/403 stop at once. A pass without success is followed by a 5 s backoff doubling to 60 s and another pass, until one budget for the whole bootstrap (25 min) is spent: a required repo then raises the summary, an optional one is skipped. "xet off" also turns hf_transfer off for that attempt; both hub globals are restored after it. snap…af469d9 -
fix(lora): fetch presets with a pinned hf_hub_download, outside the model store
Unverified signatureRouting preset clicks through model_store.ensure_repo put the startup retry loop, and its process-global xet/hf_transfer toggles, into Gradio handler threads that can run concurrently (one preset event per tab). Presets go back to a plain hf_hub_download, now with revision= pinned from presets/manifest.json, on and off Spaces. The two LoRA repos leave model_manifest.json, which now lists only what startup resolves. README preload_from_hub keeps their pinned entries, and the sync test checks those against presets/manifest.json.ddf749e -
fix(models): keep the failure summary inside the space log tail
Unverified signatureThe Space API keeps only the last 2000 characters of output, and the bootstrap summary is meant to be those characters. With an hf_xet error followed by a failed xet-off retry on every root, each root's reason carried two 300-character errors and the summary grew past 2000 characters, cutting off the line that names the repo and commit. Each root's reason is now capped at 400 characters in the summary; the full per-attempt errors are still logged as they happen.68a588f -
feat(models): resolve pinned snapshots offline before downloading
Unverified signatureThe import-time bootstrap assumed preload_from_hub had filled the hub cache and called snapshot_download unpinned, for whole repos, with no fallback. On 2026-09-22 one never-read file was missing and hf_xet could not create its cache directory; on 2026-11-18 nothing was preloaded and 30 GB came down at startup. What the platform leaves in the cache differs from start to start. model_store checks, offline and read-only, whether a root holds every manifest file at the pinned commit with the right size (following the cache symlinks), searching the hub cache, <app>/.ams-cache/hub and <tmp>/ams-cache/hub in that order. Only when none is complete does it download exactly the manifest files at the pinned commit, moving to the next root on permission, read-only or out-of-space errors, retrying an hf_xet I/O error once with xet off, and retrying anything else with capped backoff (last attempt without xet) within a per-repo deadline. A free-space check (missing bytes plus 2 GB) and a write prob…d822bee -
feat(models): add pinned model manifest
Unverified signatureThe Space bootstrap downloaded whole repos at upstream main and assumed preload_from_hub had filled the cache. model_manifest.json pins each repo to a commit and lists exactly the files the app reads, with their sizes from the Hub tree API at that commit, so startup can verify a snapshot offline and fetch only what is missing. ACE-Step/Ace-Step1.5 keeps vae/, Qwen3-Embedding-0.6B/, acestep-5Hz-lm-1.7B/ and only acestep-v15-turbo/config.json: the fork checks that the turbo directory exists but never reads its 4.79 GB weights when the DiT is XL SFT. Startup needs 25.25 GB for the required repos plus 15.24 GB for Qwen (optional); the LoRA repos are lazy.09ce210