Muhammad Taqi Raza commited on
Commit
9f42c00
·
1 Parent(s): ba8e665
Files changed (1) hide show
  1. gradio_app.py +5 -3
gradio_app.py CHANGED
@@ -38,7 +38,7 @@ def download_models():
38
 
39
 
40
  @spaces.GPU
41
- def dummy_gpu():
42
  import torch
43
  return {"cuda_available": torch.cuda.is_available()}
44
  # -----------------------------
@@ -262,7 +262,9 @@ with demo:
262
  outputs=[step2_video, step2_logs]
263
  )
264
  if __name__ == "__main__":
265
- print("Current working directory:", os.getcwd())
266
  download_models()
267
- dummy_gpu() # <--- Add this line
 
 
 
268
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
38
 
39
 
40
  @spaces.GPU
41
+ def warmup():
42
  import torch
43
  return {"cuda_available": torch.cuda.is_available()}
44
  # -----------------------------
 
262
  outputs=[step2_video, step2_logs]
263
  )
264
  if __name__ == "__main__":
 
265
  download_models()
266
+ try:
267
+ warmup() # will quietly trigger ZeroGPU once
268
+ except Exception as e:
269
+ print(f"Warmup failed: {e}")
270
  demo.launch(server_name="0.0.0.0", server_port=7860)