Spaces:
Paused
Paused
Update app.py
Browse files12345610 unmodified lines171819202122import osos.environ.setdefault("GRADIO_USE_CDN", "true")import sysimport subprocessfrom pathlib import Pathfrom typing import Tuple, Optional10 unmodified linesCACHE_DIR = SPACE_ROOT / "weights"CACHE_DIR.mkdir(parents=True, exist_ok=True)# ---------- 1) Pull weights from HF Hub ----------def get_weights_path() -> Path:weights_path = hf_hub_download(123456710 unmodified lines18192021222324252627282930313233import osos.environ.setdefault("GRADIO_USE_CDN", "true")import sysimport spacesimport subprocessfrom pathlib import Pathfrom typing import Tuple, Optional10 unmodified linesCACHE_DIR = SPACE_ROOT / "weights"CACHE_DIR.mkdir(parents=True, exist_ok=True)# --- ZeroGPU compatibility (no behavior change) ---USE_ZEROGPU = os.getenv("SPACE_RUNTIME", "").lower() == "zerogpu"if USE_ZEROGPU:import spaces@spaces.GPU(duration=60)def _zgpu_dummy():# Minimal GPU-annotated function so ZeroGPU runtime is satisfied.# We never call this; actual inference stays CPU unless you choose otherwise.return "ok"# ---------- 1) Pull weights from HF Hub ----------def get_weights_path() -> Path:weights_path = hf_hub_download(
app.py+11