Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flagging support Textbox #4327

Closed
Shengqiang-Li opened this issue May 24, 2023 · 1 comment
Closed

Flagging support Textbox #4327

Shengqiang-Li opened this issue May 24, 2023 · 1 comment

Comments

@Shengqiang-Li
Copy link

I have used gradio to build a web to test my tts model. I want to use a Textbox to record more detailed information of the badcase then use flagging button to save the recorded information to a log.csv file.

@abidlabs
Copy link
Member

Hi @Shengqiang-Li you can create an empty textbox and use it to add additional data, which will be saved when the data point is flagged. Something like this:

import gradio as gr

textbox = gr.Textbox(label="Flag data")

with gr.Blocks() as demo:
    interface = gr.Interface(lambda x:(x, None), "image", ["image", textbox])
    demo.load(lambda: textbox.update(interactive=True), None, textbox)

demo.launch()

This will be even easier when #4356 is merged. Then you'd be able to do just this:

import gradio as gr

textbox = gr.Textbox(label="Flag data", interactive=True)
gr.Interface(lambda x:(x, None), "image", ["image", textbox]).launch()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants