Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,17 @@
|
|
1 |
from spaces import GPU
|
2 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
# import numpy as np
|
4 |
# import gradio as gr
|
5 |
# import rembg
|
|
|
1 |
from spaces import GPU
|
2 |
import torch
|
3 |
+
|
4 |
+
def dummy_warmup():
|
5 |
+
if torch.cuda.is_available():
|
6 |
+
print("[INFO] CUDA is available. Running warmup.")
|
7 |
+
# Run any GPU warm-up or dummy CUDA calls here
|
8 |
+
x = torch.tensor([1.0]).cuda()
|
9 |
+
else:
|
10 |
+
print("[WARNING] CUDA not available. Skipping warmup.")
|
11 |
+
|
12 |
+
if __name__ == "__main__":
|
13 |
+
dummy_warmup()
|
14 |
+
|
15 |
# import numpy as np
|
16 |
# import gradio as gr
|
17 |
# import rembg
|