vrishv commited on
Commit
fb18834
·
verified ·
1 Parent(s): ee4c483

Start-up report of where files are stored

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -203,6 +203,15 @@ speech_pipe = pipeline("automatic-speech-recognition", model=SPEECH_MODEL, torch
203
  device="cuda", chunk_length_s=30)
204
  packs.seal("whisper", SPEECH_MODEL)
205
  print("[load] done.", flush=True)
 
 
 
 
 
 
 
 
 
206
 
207
  # With a pack per model every job fits the default half-card slice ("large"), which is billed once.
208
  # Without them ZeroGPU copies all the models on every call, and that needs the whole card.
 
203
  device="cuda", chunk_length_s=30)
204
  packs.seal("whisper", SPEECH_MODEL)
205
  print("[load] done.", flush=True)
206
+ try: # Where the downloads and packs really are, and what counts towards the disk limits
207
+ from huggingface_hub import constants as _hub
208
+ _script = ("du -xsh /root/.cache/* /root/.cache/huggingface/* /root/.zerogpu /data-nvme/* /tmp /home/* 2>/dev/null"
209
+ " | sort -h | tail -25; uname -r; free -g | head -2")
210
+ print("[where]", f"HF_HUB_CACHE={_hub.HF_HUB_CACHE} HOME={os.path.expanduser('~')} offload={packs.PACK_DIR}", "|",
211
+ subprocess.run(["sh", "-c", _script], capture_output=True, text=True, timeout=120).stdout.replace("\n", " | "),
212
+ flush=True)
213
+ except Exception as e:
214
+ print(f"[where] failed: {e}", flush=True)
215
 
216
  # With a pack per model every job fits the default half-card slice ("large"), which is billed once.
217
  # Without them ZeroGPU copies all the models on every call, and that needs the whole card.