Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
| 1 |
# ---------- Gradio CDN fix ----------
|
| 2 |
import os
|
| 3 |
os.environ.setdefault("GRADIO_USE_CDN", "true")
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
import sys
|
| 6 |
import subprocess
|
| 7 |
from pathlib import Path
|
|
@@ -15,10 +18,7 @@ from huggingface_hub import hf_hub_download
|
|
| 15 |
# >>> NEW: import spaces unconditionally and define a probe so ZeroGPU sees a @spaces.GPU fn at import time
|
| 16 |
import spaces
|
| 17 |
|
| 18 |
-
|
| 19 |
-
def _gpu_probe() -> str:
|
| 20 |
-
# Dummy function to satisfy ZeroGPU startup check. We never call it.
|
| 21 |
-
return "ok"
|
| 22 |
|
| 23 |
# Detect ZeroGPU (used only to decide whether to call GPU code)
|
| 24 |
USE_ZEROGPU = os.getenv("SPACE_RUNTIME", "").lower() == "zerogpu"
|
|
|
|
| 1 |
# ---------- Gradio CDN fix ----------
|
| 2 |
import os
|
| 3 |
os.environ.setdefault("GRADIO_USE_CDN", "true")
|
| 4 |
+
@spaces.GPU(duration=30)
|
| 5 |
+
def _gpu_probe() -> str:
|
| 6 |
+
# Dummy function to satisfy ZeroGPU startup check. We never call it.
|
| 7 |
+
return "ok"
|
| 8 |
import sys
|
| 9 |
import subprocess
|
| 10 |
from pathlib import Path
|
|
|
|
| 18 |
# >>> NEW: import spaces unconditionally and define a probe so ZeroGPU sees a @spaces.GPU fn at import time
|
| 19 |
import spaces
|
| 20 |
|
| 21 |
+
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Detect ZeroGPU (used only to decide whether to call GPU code)
|
| 24 |
USE_ZEROGPU = os.getenv("SPACE_RUNTIME", "").lower() == "zerogpu"
|