Spaces:
Running on Zero
Running on Zero
Commit ·
e298a3e
1
Parent(s): d76d484
Remove /data mount dependency and HF cache inspection
Browse filesDrop HF_HOME=/data/hf_cache override and _inspect_cache diagnostics;
models now use the default HuggingFace cache path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import os
|
|
| 2 |
import gc
|
| 3 |
import threading
|
| 4 |
|
| 5 |
-
os.environ.setdefault("HF_HOME", "/data/hf_cache")
|
| 6 |
import gradio as gr
|
| 7 |
import numpy as np
|
| 8 |
import spaces
|
|
@@ -45,26 +44,6 @@ print("[startup] all imports done", flush=True)
|
|
| 45 |
|
| 46 |
dtype = torch.bfloat16
|
| 47 |
|
| 48 |
-
def _inspect_cache(label, path):
|
| 49 |
-
if not os.path.isdir(path):
|
| 50 |
-
print(f"[startup] {label}: MISSING", flush=True)
|
| 51 |
-
return
|
| 52 |
-
blobs_dir = os.path.join(path, "blobs")
|
| 53 |
-
if os.path.isdir(blobs_dir):
|
| 54 |
-
blobs = os.listdir(blobs_dir)
|
| 55 |
-
total = sum(os.path.getsize(os.path.join(blobs_dir, b)) for b in blobs
|
| 56 |
-
if os.path.isfile(os.path.join(blobs_dir, b)))
|
| 57 |
-
print(f"[startup] {label}: {len(blobs)} blobs, {total/1024**3:.2f} GB", flush=True)
|
| 58 |
-
else:
|
| 59 |
-
print(f"[startup] {label}: dir exists but no blobs/ subdirectory", flush=True)
|
| 60 |
-
|
| 61 |
-
_hf_cache = os.path.join(os.environ.get("HF_HOME", "/data/hf_cache"), "hub")
|
| 62 |
-
print(f"[startup] HF cache dir : {_hf_cache}", flush=True)
|
| 63 |
-
if os.path.isdir(_hf_cache):
|
| 64 |
-
print(f"[startup] /hub contents: {os.listdir(_hf_cache)}", flush=True)
|
| 65 |
-
_inspect_cache("transformer (V23)", os.path.join(_hf_cache, "models--prithivMLmods--Qwen-Image-Edit-Rapid-AIO-V23"))
|
| 66 |
-
_inspect_cache("pipeline (FireRed-Image-Edit-1.1)", os.path.join(_hf_cache, "models--FireRedTeam--FireRed-Image-Edit-1.1"))
|
| 67 |
-
|
| 68 |
import time as _time
|
| 69 |
_t0_load = _time.perf_counter()
|
| 70 |
print("[startup] loading transformer from_pretrained (prithivMLmods/Qwen-Image-Edit-Rapid-AIO-V23)...", flush=True)
|
|
|
|
| 2 |
import gc
|
| 3 |
import threading
|
| 4 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
import spaces
|
|
|
|
| 44 |
|
| 45 |
dtype = torch.bfloat16
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
import time as _time
|
| 48 |
_t0_load = _time.perf_counter()
|
| 49 |
print("[startup] loading transformer from_pretrained (prithivMLmods/Qwen-Image-Edit-Rapid-AIO-V23)...", flush=True)
|