Muhammad Taqi Raza
commited on
Commit
·
9f42c00
1
Parent(s):
ba8e665
gpus
Browse files- gradio_app.py +5 -3
gradio_app.py
CHANGED
@@ -38,7 +38,7 @@ def download_models():
|
|
38 |
|
39 |
|
40 |
@spaces.GPU
|
41 |
-
def
|
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 |
-
|
|
|
|
|
|
|
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)
|