sayeed105236 commited on
Commit
4f91cdd
·
1 Parent(s): 38951d1

Fix: total_mem → total_memory for PyTorch 2.8 compatibility

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,7 +67,7 @@ async def lifespan(app: FastAPI):
67
  if not torch.cuda.is_available():
68
  raise RuntimeError("CUDA GPU required — add a GPU to this Space (Settings → Hardware).")
69
 
70
- vram_gb = torch.cuda.get_device_properties(0).total_mem / 1e9
71
  print(f"[startup] GPU: {torch.cuda.get_device_name(0)} ({vram_gb:.1f} GB VRAM)")
72
  print(f"[startup] Loading {MODEL_ID} …")
73
 
@@ -475,7 +475,7 @@ def health():
475
  "status": "ok" if gpu and pipe is not None else "loading",
476
  "gpu": gpu,
477
  "gpu_name": torch.cuda.get_device_name(0) if gpu else None,
478
- "vram_gb": round(torch.cuda.get_device_properties(0).total_mem / 1e9, 1) if gpu else None,
479
  "model_loaded": pipe is not None,
480
  "model_id": MODEL_ID,
481
  "jobs_count": len(_jobs),
 
67
  if not torch.cuda.is_available():
68
  raise RuntimeError("CUDA GPU required — add a GPU to this Space (Settings → Hardware).")
69
 
70
+ vram_gb = torch.cuda.get_device_properties(0).total_memory / 1e9
71
  print(f"[startup] GPU: {torch.cuda.get_device_name(0)} ({vram_gb:.1f} GB VRAM)")
72
  print(f"[startup] Loading {MODEL_ID} …")
73
 
 
475
  "status": "ok" if gpu and pipe is not None else "loading",
476
  "gpu": gpu,
477
  "gpu_name": torch.cuda.get_device_name(0) if gpu else None,
478
+ "vram_gb": round(torch.cuda.get_device_properties(0).total_memory / 1e9, 1) if gpu else None,
479
  "model_loaded": pipe is not None,
480
  "model_id": MODEL_ID,
481
  "jobs_count": len(_jobs),