You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import gradio as gr
def change_tab(id):
return gr.Tabs(selected=id)
with gr.Blocks() as demo:
with gr.Tabs() as tabs:
with gr.TabItem("Train", id=0): #index is 0
t = gr.Textbox()
with gr.TabItem("Inference", id=1): #index is 1
i = gr.Image()
btn = gr.Button()
# When the button is clicked, switch to Tab1 (index 1)
btn.click(change_tab, gr.Number(1, visible=False), tabs)
demo.launch()
For example, if I choose Tab4 now, I would like to select Tab1 by clicking on a button or something else. Does Gradio currently have similar features?
The text was updated successfully, but these errors were encountered: