marco-pcg commited on
Commit
dccac59
·
1 Parent(s): d6da7be

feat: add GPU decorator

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -1,9 +1,4 @@
1
- """
2
- Gradio demo for the Smart City Monitor.
3
- Each model gets its own tab.
4
-
5
- Run: python app.py
6
- """
7
  import json
8
  import gradio as gr
9
 
@@ -15,7 +10,7 @@ from inference import (
15
  autoencoder_leaks,
16
  )
17
 
18
- # ---------- Module 01: CNN ----------
19
  def cnn_fn(image):
20
  if image is None:
21
  return {"error": "No image provided"}
 
1
+ import spaces
 
 
 
 
 
2
  import json
3
  import gradio as gr
4
 
 
10
  autoencoder_leaks,
11
  )
12
 
13
+ @spaces.GPU(duration=15)
14
  def cnn_fn(image):
15
  if image is None:
16
  return {"error": "No image provided"}