I am new to using Gradio. I am attempting to modify Google Colaboratory Notebook (i.e. a Jupyter Notebook) for my own purposes.
I would like to terminate Gradio from within a gradio.Column()
that performs my function myfunc()
, once the function has been executed.
How can I end Gradio (in this case, demo
) gracefully from within the column? I have found references to gradio.Blocks.close()
and gradio.Interface.close()
but the sources I found are sparse on details on how to implement this in my example.
My structure is:
import gradio as gr
demo = gr.Blocks(title="title")
with demo:
with gr.Tab("tab"):
with gr.Row():
with gr.Column():
myfunc()
# Quit Gradio here
# Continue code execution here
my_next_func()
Please note that the Notebook is supposed to continue execute code after closing Gradio. Therefore I don't believe I can use sys.exit()
or something similar as I think it will stop all code execution in the Notebook cell.