Introducing Gradio 5.0
Read MoreIntroducing Gradio 5.0
Read MoreNew to Gradio? Start here: Getting Started
See the Release History
To install Gradio from main, run the following command:
pip install https://gradio-builds.s3.amazonaws.com/69acfebffd0d3479a40352de19c8763863557428/gradio-5.4.0-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
gradio.TabbedInterface(interface_list, ยทยทยท)
css
, js
, and head
attributes) will not be loaded. interface_list: list[Blocks]
A list of Interfaces (or Blocks) to be rendered in the tabs.
tab_names: list[str] | None
= None
A list of tab names. If None, the tab names will be "Tab 1", "Tab 2", etc.
title: str | None
= None
The tab title to display when this demo is opened in a browser window.
theme: Theme | str | None
= None
A Theme object or a string representing a theme. If a string, will look for a built-in theme with that name (e.g. "soft" or "default"), or will attempt to load a theme from the Hugging Face Hub (e.g. "gradio/monochrome"). If None, will use the Default theme.
analytics_enabled: bool | None
= None
Whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True.
css: str | None
= None
Custom css as a string or path to a css file. This css will be included in the demo webpage.
js: str | None
= None
Custom js as a string or path to a js file. The custom js should in the form of a single js function. This function will automatically be executed when the page loads. For more flexibility, use the head parameter to insert js inside <script> tags.
head: str | None
= None
Custom html to insert into the head of the demo webpage. This can be used to add custom meta tags, multiple scripts, stylesheets, etc. to the page.
import gradio as gr
hello_world = gr.Interface(lambda name: "Hello " + name, "text", "text")
bye_world = gr.Interface(lambda name: "Bye " + name, "text", "text")
demo = gr.TabbedInterface([hello_world, bye_world], ["Hello World", "Bye World"])
if __name__ == "__main__":
demo.launch()