Comments (2)
try this
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()
from gradio.
Thanks @mussonero! Yes that's the correct approach for selecting tabs programmatically
from gradio.
Related Issues (20)
- `TimeoutError: The read operation timed out` in `gradio_client` HOT 7
- Reload mode no longer able to update Interface title/description HOT 2
- Hot reloads break when loading external CSS HOT 6
- Monitor the init loading time in CI
- Variable Name HOT 2
- Gradio website loading error HOT 5
- The module gr.Sketchpad,ImageMask cannot obtain the binary image normally. HOT 1
- Output Error HOT 2
- Allow Gradio apps to take up more (full screen?) width
- Lite started to fail booting up with an installation error of a dependency HOT 1
- Unequal Icon Heights for Different Sized Images in Gradio Input and Image Source Overflowing Container Boundaries
- Rename client methods
- move away from `EventSource` HOT 2
- Change API for streams HOT 1
- How to add audio output to Chatbot HOT 1
- Feature Request/Question: How to access fastapi request object within gradio demo for multiuser auth? HOT 4
- Gradio Client package for NodeJS not connecting to HF Space, but Python one works normally. HOT 11
- Where is the gr.Image.edit() listener and the 'tool' args ? HOT 1
- dataframe can only display the first 15 rows.
- Client-side Image loads very slowly when Automatic1111 is deployed on Azure Kubernetes instance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.