import os import gradio as gr HF_API_TOKEN = os.getenv("HF_API_TOKEN") hf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, "callback-test") gr.Interface(lambda x:x, "text", "text", allow_flagging="manual", flagging_callback=hf_writer).launch()