This commit is contained in:
csunny
2023-05-11 15:40:12 +08:00
parent e132980127
commit ca50c9fe47
3 changed files with 51 additions and 28 deletions

19
examples/gradio_test.py Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import gradio as gr
def change_tab():
return gr.Tabs.update(selected=1)
with gr.Blocks() as demo:
with gr.Tabs() as tabs:
with gr.TabItem("Train", id=0):
t = gr.Textbox()
with gr.TabItem("Inference", id=1):
i = gr.Image()
btn = gr.Button()
btn.click(change_tab, None, tabs)
demo.launch()