socd06 commited on
Commit
b922c2f
·
1 Parent(s): 06798cf

rename variable to SECRET_TOKEN

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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
- HF_TOKEN = os.getenv("HF_TOKEN")
8
- print(HF_TOKEN[-1:-5])
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=gr.outputs.Label(num_top_classes=3),
26
- token=HF_TOKEN).launch()
 
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()