Introducing Gradio ClientsJoin us on Thursday, 9am PST
LivestreamIntroducing Gradio ClientsJoin us on Thursday, 9am PST
LivestreamNew 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/99f328d4be5f196d643e66f27687bdba6a3f15b5/gradio-4.33.0-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
@gr.render(inputs=···)
def hello(···):
...
inputs=
argument of @gr.render, and create a corresponding argument in your function for each component. import gradio as gr
with gr.Blocks() as demo:
input_text = gr.Textbox()
@gr.render(inputs=input_text)
def show_split(text):
if len(text) == 0:
gr.Markdown("## No Input Provided")
else:
for letter in text:
with gr.Row():
text = gr.Textbox(letter)
btn = gr.Button("Clear")
btn.click(lambda: gr.Textbox(value=""), None, text)
Parameter | Description |
---|---|
inputs list[Component] | Component | None default: None | List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list. |
triggers Sequence[EventListenerCallable] | EventListenerCallable | None default: None | List of triggers to listen to, e.g. [btn.click, number.change]. If None, will listen to changes to any inputs. |
queue bool default: True | If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app. |
trigger_mode Literal[('once', 'multiple', 'always_last')] | None default: "always_last" | If "once" (default for all events except |
concurrency_limit int | None | Literal['default'] default: None | 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 |
concurrency_id str | None default: 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. |