Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,18 @@ import tempfile
|
|
| 25 |
import gradio as gr
|
| 26 |
import httpx
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
# --------------------------------------------------------------------------- #
|
| 29 |
# Config
|
| 30 |
# --------------------------------------------------------------------------- #
|
|
|
|
| 25 |
import gradio as gr
|
| 26 |
import httpx
|
| 27 |
|
| 28 |
+
# Hugging Face ZeroGPU Spaces insist on at least one @spaces.GPU function at startup.
|
| 29 |
+
# This app never uses a GPU; this placeholder only satisfies that check and is
|
| 30 |
+
# silently skipped everywhere else (Colab, CPU Spaces).
|
| 31 |
+
try:
|
| 32 |
+
import spaces
|
| 33 |
+
|
| 34 |
+
@spaces.GPU
|
| 35 |
+
def _zero_gpu_placeholder():
|
| 36 |
+
return None
|
| 37 |
+
except Exception:
|
| 38 |
+
pass
|
| 39 |
+
|
| 40 |
# --------------------------------------------------------------------------- #
|
| 41 |
# Config
|
| 42 |
# --------------------------------------------------------------------------- #
|