Gradio Agents & MCP Hackathon · Virtual, June 2-8 · $10k+ in prizes
Register NowGradio Agents & MCP Hackathon · Virtual, June 2-8 · $10k+ in prizes
Register NowNew to Gradio? Start here: Getting Started
See the Release History
gradio.SimpleCSVLogger(···)
import gradio as gr
def image_classifier(inp):
return {'cat': 0.3, 'dog': 0.7}
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label",
flagging_callback=SimpleCSVLogger())
gradio.CSVLogger(···)
import gradio as gr
def image_classifier(inp):
return {'cat': 0.3, 'dog': 0.7}
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label",
flagging_callback=CSVLogger())
gradio.HuggingFaceDatasetSaver(hf_token, dataset_name, ···)
import gradio as gr
hf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, "image-classification-mistakes")
def image_classifier(inp):
return {'cat': 0.3, 'dog': 0.7}
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label",
allow_flagging="manual", flagging_callback=hf_writer)
hf_token: str
The HuggingFace token to use to create (and write the flagged sample to) the HuggingFace dataset (defaults to the registered one).
dataset_name: str
The repo_id of the dataset to save the data to, e.g. "image-classifier-1" or "username/image-classifier-1".