ethanweber
commited on
Commit
·
0080de0
1
Parent(s):
f863f0c
new decorations
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
5 |
|
|
|
6 |
def predict(input_img):
|
7 |
predictions = pipeline(input_img)
|
8 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
6 |
|
7 |
+
@spaces.GPU
|
8 |
def predict(input_img):
|
9 |
predictions = pipeline(input_img)
|
10 |
return input_img, {p["label"]: p["score"] for p in predictions}
|