text stringlengths 0 2k | heading1 stringlengths 3 79 | source_page_url stringclasses 188
values | source_page_title stringclasses 188
values |
|---|---|---|---|
ne object to use.
| from_pipeline | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | integrate | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
e%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... | integrate | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
wandb: ModuleType | None
default `= None`
If the wandb module is provided, will integrate with it and appear on WandB
dashboard
mlflow: ModuleType | None
default `= None`
If the mlflow module is provided, will integrate with the experiment and
appear on ML Flow dashboard
| integrate | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | queue | https://gradio.app/docs/gradio/interface | Gradio - Interface 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%2... | queue | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
ro%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.3L391.3%20319.9C381%... | queue | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
send status at regular intervals set by this
parameter as the number of seconds.
api_open: bool | None
default `= None`
If True, the REST routes of the backend will be open, allowing requests made
directly to those endpoints to skip the queue.
max_size: int | None
default `= None`
T... | queue | https://gradio.app/docs/gradio/interface | Gradio - Interface Docs |
Used to render arbitrary Markdown output. Can also render latex enclosed by
dollar signs as well as code blocks with syntax highlighting. Supported
languages are bash, c, cpp, go, java, javascript, json, php, python, rust,
sql, and yaml. As this component does not accept user input, it is rarely used
as an input compon... | Description | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
**Using Markdown as an input component.**
How Markdown will pass its value to your function:
Type: `str | None`
Passes the `str` of Markdown corresponding to the displayed value.
Example Code
import gradio as gr
def predict(
value: str | None
):
... | Behavior | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
Parameters ▼
value: str | I18nData | Callable | None
default `= None`
Value to show in Markdown component. If a function is provided, the function
will be called each time the app loads to set the initial value of this
component.
label: str | I18nData | None
default `= None`
This par... | Initialization | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
If False, component will be hidden. If "hidden", component will be visually
hidden and not take up space in the layout but still exist in the DOM
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... | Initialization | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
nored.
header_links: bool
default `= False`
If True, will automatically create anchors for headings, displaying a link
icon on hover.
height: int | str | None
default `= None`
The height of the component, specified in pixels if a number is passed, or in
CSS units if a string is passe... | Initialization | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
Shortcuts
gradio.Markdown
Interface String Shortcut `"markdown"`
Initialization Uses default values
| Shortcuts | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
blocks_helloblocks_kinematics
| Demos | https://gradio.app/docs/gradio/markdown | Gradio - Markdown 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 Markdown component supports the followi... | Event Listeners | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
et[Component | BlockContext] | None
default `= None`
List of gradio.components to use as outputs. If the function returns no
outputs, this should be an empty list.
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... | Event Listeners | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
pp.
batch: bool
default `= False`
If True, then the function should process a batch of inputs, meaning that it
should accept a list of input values for each parameter. 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... | Event Listeners | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
fter the
pending event is complete.
js: str | Literal[True] | None
default `= None`
Optional frontend js method to run before running 'fn'. Input arguments for js
method are values of 'inputs' and 'outputs', return should be a list of values
for output components.
concurrency_limit: in... | Event Listeners | https://gradio.app/docs/gradio/markdown | Gradio - Markdown Docs |
nal 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 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/markdown | Gradio - Markdown 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 |
The gr.DeletedFileData class is a subclass of gr.EventData that
specifically carries information about the `.delete()` event. When
gr.DeletedFileData is added as a type hint to an argument of an event listener
method, a gr.DeletedFileData object will automatically be passed as the value
of that argument. The attributes... | Description | https://gradio.app/docs/gradio/deletedfiledata | Gradio - Deletedfiledata Docs |
import gradio as gr
def test(delete_data: gr.DeletedFileData):
return delete_data.file.path
with gr.Blocks() as demo:
files = gr.File(file_count="multiple")
deleted_file = gr.File()
files.delete(test, None, deleted_file)
demo.launch()
| Example Usage | https://gradio.app/docs/gradio/deletedfiledata | Gradio - Deletedfiledata Docs |
Parameters ▼
file: FileData
The file that was deleted, as a FileData object. The str path to the file can
be retrieved with the .path attribute.
| Attributes | https://gradio.app/docs/gradio/deletedfiledata | Gradio - Deletedfiledata Docs |
file_component_events
| Demos | https://gradio.app/docs/gradio/deletedfiledata | Gradio - Deletedfiledata Docs |
Creates a chatbot that displays user-submitted messages and responses.
Supports a subset of Markdown including bold, italics, code, tables. Also
supports audio/video/image files, which are displayed in the Chatbot, and
other kinds of files which are displayed as links. This component is usually
used as an output compon... | Description | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
The Chatbot component accepts a list of messages, where each message is a
dictionary with `role` and `content` keys. This format is compatible with the
message format expected by most LLM APIs (OpenAI, Claude, HuggingChat, etc.),
making it easy to pipe model outputs directly into the component.
The `role` key should b... | Behavior | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
Parameters ▼
value: list[MessageDict | Message] | Callable | None
default `= None`
Default list of messages to show in chatbot, where each message is of the
format {"role": "user", "content": "Help me."}. Role can be one of "user",
"assistant", or "system". Content should be either text, or media pass... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
ide
as B. Should be an integer. scale applies in Rows, and to top-level Components
in Blocks where fill_height=True.
min_width: int
default `= 160`
minimum pixel width, will wrap if not sufficient screen space to satisfy this
value. If a certain scale value results in this Component being narrower tha... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
parameters from this component's constructor. Inside a gr.render()
function, if a component is re-rendered with the same key, these (and only
these) parameters will be preserved in the UI (if they have been changed by
the user or an event listener) instead of re-rendered based on the values
provided during constructor.... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
pen delimiter (str), "right": close
delimiter (str), "display": whether to display in newline (bool)} that will be
used to render LaTeX expressions. If not provided, `latex_delimiters` is set
to `[{ "left": "$$", "right": "$$", "display": True }]`, so only expressions
enclosed in $$ delimiters will be rendered as LaTeX... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
rder). Pass
None for either the user or bot image to skip. Must be within the working
directory of the Gradio app or an external URL.
sanitize_html: bool
default `= True`
If False, will disable HTML sanitization for chatbot messages. This is not
recommended, as it can lead to security vulnerabilities.... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
ered
vertically and horizontally in the Chatbot. Supports Markdown and HTML. If
None, no placeholder is displayed.
examples: list[ExampleMessage] | None
default `= None`
A list of example messages to display in the chatbot before any user/assistant
messages are shown. Each example should be a dictiona... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
and displayed in a separate collapsible
message with metadata={"title": "Reasoning"}. For example, [("<thinking>",
"</thinking>")] will extract content between <thinking> and </thinking> tags.
Each thinking block will be displayed as a separate collapsible message before
the main response. If None (default), no automat... | Initialization | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
Shortcuts
gradio.Chatbot
Interface String Shortcut `"chatbot"`
Initialization Uses default values
| Shortcuts | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
**Displaying Thoughts/Tool Usage**
You can provide additional metadata regarding any tools used to generate the
response. This is useful for displaying the thought process of LLM agents. For
example,
def generate_response(history):
history.append(
ChatMessage(role="assistant",
... | Examples | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
deo("https://github.com/gradio-app/gradio/raw/main/gradio/media_assets/videos/world.mp4")}
]
with gr.Blocks() as demo:
chatbot = gr.Chatbot()
button = gr.Button("Load audio and video")
button.click(load, None, chatbot)
demo.launch()
| Examples | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
chatbot_simplechatbot_streamingchatbot_with_toolschatbot_core_components
| Demos | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot 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 Chatbot component supports the followin... | Event Listeners | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
s event has SelectData of type gradio.SelectData that carries
information, accessible through SelectData.index and SelectData.value. See
SelectData documentation on how to use this event data.
Chatbot.option_select(fn, ···)
This listener is triggered when the user clicks on an option from within the
Cha... | Event Listeners | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
ckContext] | Set[Component | BlockContext] | None
default `= None`
List of gradio.components to use as outputs. If the function returns no
outputs, this should be an empty list.
api_name: str | None
default `= None`
defines how the endpoint appears in the API docs. Can be a string or None. If
set to... | Event Listeners | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
f the gradio app.
batch: bool
default `= False`
If True, then the function should process a batch of inputs, meaning that it
should accept a list of input values for each parameter. The lists should be
of equal length (and be up to length `max_batch_size`). The function is then
*required* to return a ... | Event Listeners | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
d submission after the
pending event is complete.
js: str | Literal[True] | None
default `= None`
Optional frontend js method to run before running 'fn'. Input arguments for js
method are values of 'inputs' and 'outputs', return should be a list of values
for output components.
concurr... | Event Listeners | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
= 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 function be called. The validator
receives the same inputs as the main function and should return a
`gr.validate()` for each inpu... | Event Listeners | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
Helper Classes | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs | |
gradio.ChatMessage(···)
Description
A dataclass that represents a message in the Chatbot component (with
type="messages"). The only required field is `content`. The value of
`gr.Chatbot` is a list of these dataclasses.
Parameters ▼
content: MessageContent | list[MessageContent]
The content of the me... | ChatMessage | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
A typed dictionary to represent metadata for a message in the Chatbot
component. An instance of this dictionary is used for the `metadata` field in
a ChatMessage when the chat message should be displayed as a thought.
Keys ▼
title: str
The title of the 'thought' message. Only required field.
... | MetadataDict | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
A typed dictionary to represent an option in a ChatMessage. A list of these
dictionaries is used for the `options` field in a ChatMessage.
Keys ▼
value: str
The value to return when the option is selected.
label: str
The text to display in the option, if different from the value.
[Ch... | OptionDict | https://gradio.app/docs/gradio/chatbot | Gradio - Chatbot Docs |
Group is a layout element within Blocks which groups together children so
that they do not have any padding or margin between them.
| Description | https://gradio.app/docs/gradio/group | Gradio - Group Docs |
with gr.Group():
gr.Textbox(label="First")
gr.Textbox(label="Last")
| Example Usage | https://gradio.app/docs/gradio/group | Gradio - Group Docs |
Parameters ▼
visible: bool | Literal['hidden']
default `= True`
If False, group will be hidden.
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: li... | Initialization | https://gradio.app/docs/gradio/group | Gradio - Group Docs |
The gr.CopyData class is a subclass of gr.EventData that specifically
carries information about the `.copy()` event. When gr.CopyData is added as a
type hint to an argument of an event listener method, a gr.CopyData object
will automatically be passed as the value of that argument. The attributes of
this object contain... | Description | https://gradio.app/docs/gradio/copydata | Gradio - Copydata Docs |
import gradio as gr
def on_copy(copy_data: gr.CopyData):
return f"Copied text: {copy_data.value}"
with gr.Blocks() as demo:
textbox = gr.Textbox("Hello World!")
copied = gr.Textbox()
textbox.copy(on_copy, None, copied)
demo.launch()
| Example Usage | https://gradio.app/docs/gradio/copydata | Gradio - Copydata Docs |
Parameters ▼
value: Any
The value that was copied.
| Attributes | https://gradio.app/docs/gradio/copydata | Gradio - Copydata Docs |
Used to create an upload button, when clicked allows a user to upload files
that satisfy the specified file type or generic files (if file_type not set).
| Description | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
**Using UploadButton as an input component.**
How UploadButton will pass its value to your function:
Type: `bytes | str | list[bytes] | list[str] | None`
Passes the file as a `str` or `bytes` object, or a list of `str` or list of
`bytes` objects, depending on `type` and `file_count`.
Example Code
... | Behavior | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
Parameters ▼
label: str
default `= "Upload a File"`
Text to display on the button. Defaults to "Upload a File".
value: str | I18nData | list[str] | Callable | None
default `= None`
File or list of files to upload by default.
every: Timer | float | None
default `= Non... | Initialization | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
idth: int | None
default `= None`
minimum pixel width, will wrap if not sufficient screen space to satisfy this
value. If a certain scale value results in this Component being narrower than
min_width, the min_width parameter will be respected first.
interactive: bool
default `= True`
If False, the U... | Initialization | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
h the same base name as the uploaded file, whose full path can be
retrieved by file_obj.name, "binary" returns an bytes object.
file_count: Literal['single', 'multiple', 'directory']
default `= "single"`
if single, allows user to upload one file. If "multiple", user uploads
multiple files. If "directo... | Initialization | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
Shortcuts
gradio.UploadButton
Interface String Shortcut `"uploadbutton"`
Initialization Uses default values
| Shortcuts | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
upload_and_downloadupload_button
| Demos | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton 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 UploadButton component supports the fol... | Event Listeners | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
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 be a string, None, or False. If set to a
string, the endpoint will be exposed in the API docs with ... | Event Listeners | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
onent), 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 batch=True)
preprocess: bool
default `= True`
If False, will not run preprocessin... | Event Listeners | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
t `= "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 "default" to use the default
concurrency limit (defined by the `default_concurrency_limit` parameter in
`... | Event Listeners | https://gradio.app/docs/gradio/uploadbutton | Gradio - Uploadbutton Docs |
Interface is Gradio's main high-level class, and allows you to create a
web-based GUI / demo around a machine learning model (or any Python function)
in a few lines of code. You must specify three parameters: (1) the function to
create a GUI for (2) the desired input components and (3) the desired output
components. Ad... | Description | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
import gradio as gr
def image_classifier(inp):
return {'cat': 0.3, 'dog': 0.7}
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
demo.launch()
| Example Usage | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
Parameters ▼
fn: Callable
the function to wrap an interface around. 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 the tuple corresponding t... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
If True, caches examples in the server for fast runtime in examples. If
"lazy", then examples are cached (for all users of the app) after their first
use (by any user of the app). If None, will use the GRADIO_CACHE_EXAMPLES
environment variable, which should be either "true" or "false". In HuggingFace
Spaces, this pa... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
tically rerun if any of the inputs change.
title: str | I18nData | None
default `= None`
a title for the interface; if provided, appears above the input and output
components in large font. Also used as the tab title when opened in a browser
window.
description: str | None
default `= ... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
s ["X", "Y"], in which case the values will be the
list of strings and the labels will ["Flag as X", "Flag as Y"], etc.
flagging_dir: str
default `= ".gradio/flagged"`
path to the directory where flagged data is stored. If the directory does not
exist, it will be created.
flagging_call... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
None`
defines how the prediction 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, the name of the function will be used.
api_description: str | None | Literal[False]
default `= None`
Description ... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
an be provided as well to
configure other properties of the container holding the additional inputs.
Defaults to a `gr.Accordion(label="Additional Inputs", open=False)`. This
parameter is only used if `additional_inputs` is provided.
submit_btn: str | Button
default `= "Submit"`
the button to use for ... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
'minimal', 'hidden']
default `= "full"`
how to show the progress 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
... | Initialization | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
hello_worldhello_world_2hello_world_3
| Demos | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
Methods | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs | |
%20Copyright%202022%20Fonticons,%20Inc.... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
c!--!%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%... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
2'%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.%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%2... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
pp inline in an iframe. Defaults to True in
python notebooks; False otherwise.
inbrowser: bool
default `= False`
whether to automatically launch the gradio app in a new tab on the default
browser.
share: bool | None
default `= None`
whether to create a publicly shareable link for the... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
an alert modal and
printed in the browser console log. They will also be displayed in the alert
modal of downstream apps that gr.load() this app.
server_name: str | None
default `= None`
to make app accessible on local network, set this to "0.0.0.0". Can be set by
environment variable GRADIO_SERVER_NA... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
inks: list[Literal['api', 'gradio', 'settings'] | dict[str, str]] | None
default `= None`
The links to display in the footer of the app. Accepts a list, where each
element of the list must be one of "api", "gradio", or "settings"
corresponding to the API docs, "built with Gradio", and settings pages
respectively. If ... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
be set by
environment variable GRADIO_ROOT_PATH. Defaults to "".
app_kwargs: dict[str, Any] | None
default `= None`
Additional keyword arguments to pass to the underlying FastAPI app as a
dictionary of parameter keys and argument values. For example, `{"docs_url":
"/docs"}`
state_sessi... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
] | None
default `= None`
A function that takes a FastAPI request and returns a string user ID or None.
If the function returns None for a specific request, that user is not
authorized to access the app (they will see a 401 Unauthorized response). To
be used with external authentication systems like OAuth. Cannot be ... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
vironment variable or default to False.
pwa: bool | None
default `= None`
If True, the Gradio app will be set up as an installable PWA (Progressive Web
App). If set to None (default behavior), then the PWA feature will be enabled
if this Gradio app is launched on Spaces, but not otherwise.
... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
ly be executed when
the page loads. For more flexibility, use the head parameter to insert js
inside <script> tags.
head: str | None
default `= None`
Custom html code 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.... | launch | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | load | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
%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.%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%203... | load | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
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 the tuple corresponding to one output component.
inputs: Component | BlockContext | list[Component | BlockContext] | Set[Compo... | load | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
shows the runtime display, "hidden"
shows no progress animation at all
show_progress_on: Component | list[Component] | None
default `= None`
Component or list of components to show the progress animation on. If None,
will show the progress animation on all of the output components.
que... | load | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
ponents .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.
trigger_mode: Literal['once', 'multiple', 'always_last'] | None
default `= None`
If "once" (default for all events except `.c... | load | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
nted" (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
default `= None`
stream_every: float
default `= 0.5`
key: int | str | tuple[int | str, ...] | None
default... | load | https://gradio.app/docs/gradio/interface#interface-queue | Gradio - Interface#Interface Queue Docs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.