|
|
|
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") |
|
|
|
|
|
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() |
|
|