Spaces:
Sleeping
Sleeping
feat: add GPU decorator
Browse files
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 |
-
|
| 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"}
|