Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,6 +31,21 @@ import matplotlib.ticker as mticker
|
|
| 31 |
from scipy import signal
|
| 32 |
import gradio as gr
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 35 |
# Constants
|
| 36 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 31 |
from scipy import signal
|
| 32 |
import gradio as gr
|
| 33 |
|
| 34 |
+
# This app is CPU-only (librosa/scipy/matplotlib). The `spaces` import is only
|
| 35 |
+
# needed if this Space is ever configured with ZeroGPU hardware, which requires
|
| 36 |
+
# at least one @spaces.GPU-decorated function to exist at startup. Recommended
|
| 37 |
+
# setting is "CPU basic" under Space Settings β Hardware, in which case `spaces`
|
| 38 |
+
# won't even be installed and the block below is simply skipped.
|
| 39 |
+
try:
|
| 40 |
+
import spaces
|
| 41 |
+
|
| 42 |
+
@spaces.GPU(duration=1)
|
| 43 |
+
def _zerogpu_keepalive():
|
| 44 |
+
"""No-op so ZeroGPU Spaces pass their startup check. Not used on CPU."""
|
| 45 |
+
return None
|
| 46 |
+
except ImportError:
|
| 47 |
+
pass
|
| 48 |
+
|
| 49 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 50 |
# Constants
|
| 51 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|