WasuratS commited on
Commit
18733eb
Β·
verified Β·
1 Parent(s): 59a7af5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
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
  # ──────────────────────────────────────────────────────────────────────────────