File size: 650 Bytes
d9f024f
63399bb
adf1c79
d9f024f
f2ec30a
d9f024f
adf1c79
d9f024f
 
 
 
 
 
 
0420f0c
63399bb
0420f0c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#### ignore these lines -- just needed to install and build a particular branch
import os
os.system("git clone https://github.com/gradio-app/gradio.git")
os.system("cd gradio")
os.system("git fetch")
os.system("git checkout flagging-spaces")
os.system("pip uninstall -y gradio")
os.system("pip install -e gradio")
os.system("cd frontend")
os.system("npm install")
os.system("npm run build")
### Real code is below

import gradio as gr

HF_TOKEN = os.getenv('HF_TOKEN')

hf_saver = gr.HuggingFaceDatasetSaver(HF_TOKEN, "test-image-classifier-dataset")

gr.Interface.load("huggingface/google/vit-base-patch16-224", flagging_callback=hf_saver).launch()