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 -
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(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