Spaces:
Sleeping
Sleeping
socd06
commited on
Commit
·
b922c2f
1
Parent(s):
06798cf
rename variable to SECRET_TOKEN
Browse files
app.py
CHANGED
@@ -3,9 +3,10 @@ from huggingface_hub import from_pretrained_fastai
|
|
3 |
|
4 |
import gradio as gr
|
5 |
from gradio.components import Image
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
repo_id = "artificeresearch/spiritvision"
|
10 |
learner = from_pretrained_fastai(repo_id)
|
11 |
labels = learner.dls.vocab
|
@@ -22,5 +23,5 @@ def predict_fn(img):
|
|
22 |
|
23 |
gr.Interface(predict_fn,
|
24 |
Image(shape=(512, 512)),
|
25 |
-
outputs=
|
26 |
-
|
|
|
3 |
|
4 |
import gradio as gr
|
5 |
from gradio.components import Image
|
6 |
+
from gradio import Label
|
7 |
|
8 |
+
|
9 |
+
SECRET_TOKEN = os.getenv("SECRET_TOKEN")
|
10 |
repo_id = "artificeresearch/spiritvision"
|
11 |
learner = from_pretrained_fastai(repo_id)
|
12 |
labels = learner.dls.vocab
|
|
|
23 |
|
24 |
gr.Interface(predict_fn,
|
25 |
Image(shape=(512, 512)),
|
26 |
+
outputs=Label(num_top_classes=3),
|
27 |
+
hf_token=SECRET_TOKEN).launch()
|