Spaces:
Sleeping
Sleeping
socd06
commited on
Commit
·
4beb837
1
Parent(s):
7e8254c
add call to token
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
import
|
2 |
-
from huggingface_hub import from_pretrained_fastai, login
|
3 |
|
4 |
import gradio as gr
|
5 |
|
6 |
repo_id = "artificeresearch/spiritvision"
|
7 |
learner = from_pretrained_fastai(repo_id)
|
8 |
labels = learner.dls.vocab
|
|
|
9 |
|
10 |
|
11 |
def predict_fn(img):
|
@@ -21,4 +21,4 @@ def predict_fn(img):
|
|
21 |
|
22 |
gr.Interface(predict_fn,
|
23 |
gr.inputs.Image(type='pil', shape=(512, 512)),
|
24 |
-
outputs=gr.outputs.Label(num_top_classes=3)).launch()
|
|
|
1 |
+
from huggingface_hub import from_pretrained_fastai
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
repo_id = "artificeresearch/spiritvision"
|
6 |
learner = from_pretrained_fastai(repo_id)
|
7 |
labels = learner.dls.vocab
|
8 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
9 |
|
10 |
|
11 |
def predict_fn(img):
|
|
|
21 |
|
22 |
gr.Interface(predict_fn,
|
23 |
gr.inputs.Image(type='pil', shape=(512, 512)),
|
24 |
+
outputs=gr.outputs.Label(num_top_classes=3), token=HF_TOKEN).launch()
|