Is there a way to kill a function in mid proccess?

Hi,

In the docs there is an attribute for gradio.Button.click(cancels)

But it seems like it doesn’t really exist.

Is there a way to stop a function from running or to restart\reload the server if a button is being clicked?

I tried demo.close() which closes the server but won’t restart/reload the server.

Thank you for your wonderful support.

Hi @LittleWing !

Yes, you can use the cancels keyword!

This was introduced in version 3.7 I believe.

Take a look at this example:

Thank you so much! @freddyaboulton

I needed to upgrade Gradio package, now I’m synced with the docs!

one more tiny thing if I may, Do you have any idea if I can uncheck a gr.Checkbox if I’m typing something on an input gr.Textbox?

I tried to play with it, but since I need to call a function under gr.Texbox.change I can’t really achieve it.

Thank you!!