text
stringlengths
0
2k
heading1
stringlengths
3
79
source_page_url
stringclasses
186 values
source_page_title
stringclasses
186 values
ies an event as identical across re-renders when the key is identical. validator: Callable | None default `= None` Optional validation function to run before the main function. If provided, this function will be executed first with queue=False, and only if it completes successfully will the main funct...
Event Listeners
https://gradio.app/docs/gradio/model3d
Gradio - Model3D Docs
Creates a gallery or table to display data samples. This component is primarily designed for internal use to display examples. However, it can also be used directly to display a dataset and let users select examples.
Description
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
**Using Dataset as an input component.** How Dataset will pass its value to your function: Type: `int | list | tuple[int, list] | None` Passes the selected sample either as a `list` of data corresponding to each input component (if `type` is "value") or as an `int` index (if `type` is "index"), or as a `tuple` of th...
Behavior
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
Parameters ▼ label: str | I18nData | None default `= None` the label for this component, appears above the component. show_label: bool default `= True` If True, the label will be shown above the component. components: list[Component] | list[str] | None default `= Non...
Initialization
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
re more than one component, the layout can only be "table". samples_per_page: int default `= 10` how many examples to show per page. visible: bool | Literal['hidden'] default `= True` If False, component will be hidden. If "hidden", component will be visually hidden and not take up s...
Initialization
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
scale: int | None default `= None` relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True. ...
Initialization
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
Shortcuts gradio.Dataset Interface String Shortcut `"dataset"` Initialization Uses default values
Shortcuts
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
**Updating a Dataset** In this example, we display a text dataset using `gr.Dataset` and then update it when the user clicks a button: import gradio as gr philosophy_quotes = [ ["I think therefore I am."], ["The unexamined life is not worth living."] ] startup_quote...
Examples
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
Description Event listeners allow you to respond to user interactions with the UI components you've defined in a Gradio Blocks app. When a user interacts with an element, such as changing a slider value or uploading an image, a function is called. Supported Event Listeners The Dataset component supports the followin...
Event Listeners
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
api_name: str | None default `= None` defines how the endpoint appears in the API docs. Can be a string or None. If set to a string, the endpoint will be exposed in the API docs with the given name. If None (default), the name of the function will be used as the API endpoint. api_description: st...
Event Listeners
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
arameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component. max_batch_size: int default `= 4` Maximum numb...
Event Listeners
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
r js method are values of 'inputs' and 'outputs', return should be a list of values for output components. concurrency_limit: int | None | Literal['default'] default `= "default"` If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurr...
Event Listeners
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
function be called. The validator receives the same inputs as the main function and should return a `gr.validate()` for each input value.
Event Listeners
https://gradio.app/docs/gradio/dataset
Gradio - Dataset Docs
Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).
Description
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
**Using Audio as an input component.** How Audio will pass its value to your function: Type: `str | tuple[int, np.ndarray] | None` Passes audio as one of these formats (depending on `type`): * `str` filepath * `tuple` of (sample rate in Hz, audio data as numpy array). * The audio data is a 16-bit `int` ar...
Behavior
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
Parameters ▼ value: str | Path | tuple[int, np.ndarray] | Callable | None default `= None` A path, URL, or [sample_rate, numpy array] tuple (sample rate in Hz, audio data as a float or int numpy array) for the default value that Audio component is going to take. If a function is provided, the function...
Initialization
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
set[Component] | None default `= None` Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change. show_label: bool | None default `= None` if True, will display label. container: bool...
Initialization
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
elem_id: str | None default `= None` An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. elem_classes: list[str] | str | None default `= None` An optional list of strings that are assigned as the classes of this component in ...
Initialization
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
and the audio is kept as is. In the case where output audio is returned from the prediction function as numpy array and no `format` is provided, it will be returned as a "wav" file. autoplay: bool default `= False` Whether to automatically play the audio when the component is used as an output. Note: ...
Initialization
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
hone if the source is set to "microphone". Defaults to False. subtitles: str | Path | list[dict[str, Any]] | None default `= None` A subtitle file (srt, vtt, or json) for the audio, or a list of subtitle dictionaries in the format [{"text": str, "timestamp": [start, end]}] where timestamps are in seco...
Initialization
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
Shortcuts gradio.Audio Interface String Shortcut `"audio"` Initialization Uses default values gradio.Microphone Interface String Shortcut `"microphone"` Initialization Uses sources=["microphone"]
Shortcuts
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
generate_tonereverse_audio
Demos
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
Description Event listeners allow you to respond to user interactions with the UI components you've defined in a Gradio Blocks app. When a user interacts with an element, such as changing a slider value or uploading an image, a function is called. Supported Event Listeners The Audio component supports the following ...
Event Listeners
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
r stops recording with the Audio. Audio.upload(fn, ···) This listener is triggered when the user uploads a file into the Audio. Audio.input(fn, ···) This listener is triggered when the user changes the value of the Audio. Event Parameters Parameters ▼ fn: Callable | Non...
Event Listeners
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
f False, then no description will be displayed in the API docs. scroll_to_output: bool default `= False` If True, will scroll to output component on completion show_progress: Literal['full', 'minimal', 'hidden'] default `= "minimal"` how to show the progress animation while event is ...
Event Listeners
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
with the `Image` component). postprocess: bool default `= True` If False, will not run postprocessing of component data before returning 'fn' output to the browser. cancels: dict[str, Any] | list[dict[str, Any]] | None default `= None` A list of other events to cancel when this liste...
Event Listeners
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
= None` If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit. api_visibility: Literal['public', 'private', 'undocumented'] default `= "public"` controls the visibility and accessibility of this endpoint. Can be "publi...
Event Listeners
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
Helper Classes
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
gradio.WaveformOptions(···) Description A dataclass for specifying options for the waveform display in the Audio component. An instance of this class can be passed into the `waveform_options` parameter of `gr.Audio`. Initialization Parameters ▼ waveform_color: str | None default `= None` The color...
WaveformOptions
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
Validates that the audio length is within the specified min and max length (in seconds). You can use this to construct a validator that will check if the user-provided audio is either too short or too long. import gradio as gr demo = gr.Interface( lambda x: x, inputs="audio", ...
is_audio_correct_length
https://gradio.app/docs/gradio/audio
Gradio - Audio Docs
Constructs a Gradio app automatically from a Hugging Face model/Space repo name or a 3rd-party API provider. Note that if a Space repo is loaded, certain high-level attributes of the Blocks (e.g. custom `css`, `js`, and `head` attributes) will not be loaded.
Description
https://gradio.app/docs/gradio/load
Gradio - Load Docs
import gradio as gr demo = gr.load("gradio/question-answering", src="spaces") demo.launch()
Example Usage
https://gradio.app/docs/gradio/load
Gradio - Load Docs
Parameters ▼ name: str the name of the model (e.g. "google/vit-base-patch16-224") or Space (e.g. "flax-community/spanish-gpt2"). This is the first parameter passed into the `src` function. Can also be formatted as {src}/{repo name} (e.g. "models/google/vit-base-patch16-224") if `src` is not provided. ...
Initialization
https://gradio.app/docs/gradio/load
Gradio - Load Docs
DER_T | None default `= None` the name of the third-party (non-Hugging Face) providers to use for model inference (e.g. "replicate", "sambanova", "fal-ai", etc). Should be one of the providers supported by `huggingface_hub.InferenceClient`. This parameter is only used when `src` is "models" kwargs: <c...
Initialization
https://gradio.app/docs/gradio/load
Gradio - Load Docs
The gr.DownloadData class is a subclass of gr.EventData that specifically carries information about the `.download()` event. When gr.DownloadData is added as a type hint to an argument of an event listener method, a gr.DownloadData object will automatically be passed as the value of that argument. The attributes of thi...
Description
https://gradio.app/docs/gradio/downloaddata
Gradio - Downloaddata Docs
import gradio as gr def on_download(download_data: gr.DownloadData): return f"Downloaded file: {download_data.file.path}" with gr.Blocks() as demo: files = gr.File() textbox = gr.Textbox() files.download(on_download, None, textbox) demo.launch()
Example Usage
https://gradio.app/docs/gradio/downloaddata
Gradio - Downloaddata Docs
Parameters ▼ file: FileData The file that was downloaded, as a FileData object.
Attributes
https://gradio.app/docs/gradio/downloaddata
Gradio - Downloaddata Docs
Creates a navigation bar component for multipage Gradio apps. The navbar component allows customizing the appearance of the navbar for that page. Only one Navbar component can exist per page in a Blocks app, and it can be placed anywhere within the page. The Navbar component is designed to control the appearance of t...
Description
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
**Using Navbar as an input component.** How Navbar will pass its value to your function: Type: `list[tuple[str, str]] | None` The preprocessed input data sent to the user's function in the backend. Example Code import gradio as gr def predict( value: list[tuple[s...
Behavior
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
Parameters ▼ value: list[tuple[str, str]] | None default `= None` If a list of tuples of (page_name, page_path) are provided, these additional pages will be added to the navbar alongside the existing pages defined in the Blocks app. The page_path can be either a relative path for internal Gradio app p...
Initialization
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
Shortcuts gradio.Navbar Interface String Shortcut `"navbar"` Initialization Uses default values
Shortcuts
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
Description Event listeners allow you to respond to user interactions with the UI components you've defined in a Gradio Blocks app. When a user interacts with an element, such as changing a slider value or uploading an image, a function is called. Supported Event Listeners The Navbar component supports the following...
Event Listeners
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
the API docs. Can be a string or None. If set to a string, the endpoint will be exposed in the API docs with the given name. If None (default), the name of the function will be used as the API endpoint. api_description: str | None | Literal[False] default `= None` Description of the API endpoint. Can...
Event Listeners
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
e`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component. max_batch_size: int default `= 4` Maximum number of inputs to batch together if this is called from the queue (only relevant if...
Event Listeners
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
es for output components. concurrency_limit: int | None | Literal['default'] default `= "default"` If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "defa...
Event Listeners
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
and should return a `gr.validate()` for each input value. [Multipage Apps](../../guides/multipage-apps/)
Event Listeners
https://gradio.app/docs/gradio/navbar
Gradio - Navbar Docs
Walkthrough is a layout element within Blocks that can contain multiple "Step" Components, which can be used to create a step-by-step workflow.
Description
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
with gr.Walkthrough(selected=1) as walkthrough: with gr.Step("Step 1", id=1): btn = gr.Button("go to Step 2") btn.click(lambda: gr.Walkthrough(selected=2), outputs=walkthrough) with gr.Step("Step 2", id=2): txt = gr.Textbox("Welcome to Step 2")
Example Usage
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
Parameters ▼ selected: int | None default `= None` The currently selected step. Must be a number corresponding to the step number. Defaults to the first step. visible: bool default `= True` If False, Walkthrough will be hidden. elem_id: str | None default `= None` A...
Initialization
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
walkthrough
Demos
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
Methods
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392....
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
fn: Callable | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of valu...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
animation while event is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None default `= N...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running wil...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
s endpoint. Can be "public" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". ...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392....
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
rs ▼ fn: Callable | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple o...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
gress animation while event is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None defaul...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
vents to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently runni...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
of this endpoint. Can be "public" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". ...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
tring that is assigned as the id of the <div> containing the contents of the Step layout. The same string followed by "-button" is attached to the Step button. Can be used for targeting CSS styles. elem_classes: list[str] | str | None default `= None` An optional string or list of strings that are ass...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392.4%20318...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
lable | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element ...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None default `= None` Component or lis...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
stener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
blic" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". time_limit: int | N...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392....
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
fn: Callable | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of valu...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
animation while event is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None default `= N...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running wil...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
s endpoint. Can be "public" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". ...
change
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392....
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
rs ▼ fn: Callable | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple o...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
gress animation while event is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None defaul...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
vents to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently runni...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
of this endpoint. Can be "public" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". ...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392.4%20318...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
lable | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element ...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
is running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None default `= None` Component or lis...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
stener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
blic" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". time_limit: int | N...
select
https://gradio.app/docs/gradio/walkthrough
Gradio - Walkthrough Docs
Tab (or its alias TabItem) is a layout element. Components defined within the Tab will be visible when this tab is selected tab.
Description
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
with gr.Blocks() as demo: with gr.Tab("Lion"): gr.Image("lion.jpg") gr.Button("New Lion") with gr.Tab("Tiger"): gr.Image("tiger.jpg") gr.Button("New Tiger")
Example Usage
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
Parameters ▼ label: str | I18nData | None default `= None` The visual label for the tab visible: bool | Literal['hidden'] default `= True` If False, Tab will be hidden. interactive: bool default `= True` If False, Tab will not be clickable. id: int |...
Initialization
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
Methods
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392.4%20318....
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
le | None | Literal['decorator'] default `= "decorator"` the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in ...
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
running: "full" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, "minimal" only shows the runtime display, "hidden" shows no progress animation at all show_progress_on: Component | list[Component] | None default `= None` Component or list o...
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
ner is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish. ...
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
c" (shown in API docs and callable by clients), "private" (hidden from API docs and not callable by the Gradio client libraries), or "undocumented" (hidden from API docs but callable by clients and via gr.load). If fn is None, api_visibility will automatically be set to "private". time_limit: int | None...
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
![](data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='%23808080'%20viewBox='0%200%20640%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc....
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs
20Font%20Awesome%20Pro%206.0.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20\(Commercial%20License\)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20d='M172.5%20131.1C228.1%2075.51%20320.5%2075.51%20376.1%20131.1C426.1%20181.1%20433.5%20260.8%20392.4%20318....
select
https://gradio.app/docs/gradio/tab
Gradio - Tab Docs