text stringlengths 0 2k | heading1 stringlengths 3 79 | source_page_url stringclasses 186
values | source_page_title stringclasses 186
values |
|---|---|---|---|
n (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 `.change()`) would not allow any
submissions while an ev... | Event Listeners | https://gradio.app/docs/gradio/image | Gradio - Image Docs |
nd 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 `= None`
A unique key for this event listener to be... | Event Listeners | https://gradio.app/docs/gradio/image | Gradio - Image Docs |
Helper Classes | https://gradio.app/docs/gradio/image | Gradio - Image Docs | |
gradio.WebcamOptions(···)
Description
A dataclass for specifying options for the webcam tool in the ImageEditor
component. An instance of this class can be passed to the `webcam_options`
parameter of `gr.ImageEditor`.
Initialization
Parameters ▼
mirror: bool
default `= True`
If True, the webcam wi... | Webcam Options | https://gradio.app/docs/gradio/image | Gradio - Image Docs |
Displays an interactive table of parameters and their descriptions and
default values with syntax highlighting. For each parameter, the user should
provide a type (e.g. a `str`), a human-readable description, and a default
value. As this component does not accept user input, it is rarely used as an
input component. Int... | Description | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
**Using ParamViewer as an input component.**
How ParamViewer will pass its value to your function:
Type: `dict[str, Parameter]`
(Rarely used) passes value as a `dict[str, dict]`. The key in the outer
dictionary is the parameter name, while the inner dictionary has keys "type",
"description", and "default" for each p... | Behavior | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
Parameters ▼
value: dict[str, Parameter] | None
default `= None`
A dictionary of dictionaries. The key in the outer dictionary is the parameter
name, while the inner dictionary has keys "type", "description", and "default"
for each parameter. Markdown links are supported in "description".
... | Initialization | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
er()
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.
header: str | None
default `= "Parameters"`
... | Initialization | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
Shortcuts
gradio.ParamViewer
Interface String Shortcut `"paramviewer"`
Initialization Uses default values
| Shortcuts | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer 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 ParamViewer component supports the foll... | Event Listeners | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
rns 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 endpoint will be exposed in the API docs with the given
name. If None (default), the name of the function will be used ... | Event Listeners | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
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 (even if there is only 1 output
component), with each list in the tuple corresponding to one output component.
... | Event Listeners | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
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: int | None | Literal['default']
default `= "default"`
If set, this is the maximum number of this event that can be runni... | Event Listeners | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
lse, 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.
[Documenting Custom Components](../../guides/documenting-custom-components/)
| Event Listeners | https://gradio.app/docs/gradio/paramviewer | Gradio - Paramviewer Docs |
A base class for defining methods that all input/output components should
have.
| Description | https://gradio.app/docs/gradio/state | Gradio - State Docs |
**Using State as an input component.**
How State will pass its value to your function:
Type: `Any`
Passes a value of arbitrary type through.
Example Code
import gradio as gr
def predict(
value: Any
):
process value from the State component
... | Behavior | https://gradio.app/docs/gradio/state | Gradio - State Docs |
Parameters ▼
value: Any
default `= None`
the initial value (of arbitrary type) of the state. The provided argument is
deepcopied. If a callable is provided, the function will be called whenever
the app loads to set the initial value of the state.
render: bool
default `= True`
should ... | Initialization | https://gradio.app/docs/gradio/state | Gradio - State 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 State component supports the following ... | Event Listeners | https://gradio.app/docs/gradio/state | Gradio - State Docs |
e 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 be... | Event Listeners | https://gradio.app/docs/gradio/state | Gradio - State Docs |
. 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 ba... | Event Listeners | https://gradio.app/docs/gradio/state | Gradio - State Docs |
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 "default... | Event Listeners | https://gradio.app/docs/gradio/state | Gradio - State Docs |
should return a
`gr.validate()` for each input value.
| Event Listeners | https://gradio.app/docs/gradio/state | Gradio - State Docs |
When gr.EventData or one of its subclasses is added as a type hint to an
argument of a prediction function, a gr.EventData object will automatically be
passed as the value of that argument. The attributes of this object contains
information about the event that triggered the listener. The gr.EventData
object itself con... | Description | https://gradio.app/docs/gradio/eventdata | Gradio - Eventdata Docs |
import gradio as gr
with gr.Blocks() as demo:
table = gr.Dataframe([[1, 2, 3], [4, 5, 6]])
gallery = gr.Gallery([("cat.jpg", "Cat"), ("dog.jpg", "Dog")])
textbox = gr.Textbox("Hello World!")
statement = gr.Textbox()
def on_select(value, evt: gr.EventData):
... | Example Usage | https://gradio.app/docs/gradio/eventdata | Gradio - Eventdata Docs |
Parameters ▼
target: Block | None
The component object that triggered the event. Can be used to distinguish
multiple components bound to the same listener.
| Attributes | https://gradio.app/docs/gradio/eventdata | Gradio - Eventdata Docs |
gallery_selectionstictactoe
[Blocks And Event Listeners](../../guides/blocks-and-event-listeners/)
| Demos | https://gradio.app/docs/gradio/eventdata | Gradio - Eventdata Docs |
Creates a "Sign In" button that redirects the user to sign in with Hugging
Face OAuth. Once the user is signed in, the button will act as a logout
button, and you can retrieve a signed-in user's profile by adding a parameter
of type `gr.OAuthProfile` to any Gradio function. This will only work if this
Gradio app is run... | Description | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
**Using LoginButton as an input component.**
How LoginButton will pass its value to your function:
Type: `str | None`
(Rarely used) the `str` corresponding to the button label when the button is
clicked
Example Code
import gradio as gr
def predict(
value: str | N... | Behavior | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
Parameters ▼
value: str
default `= "Sign in with Hugging Face"`
logout_value: str
default `= "Logout ({})"`
The text to display when the user is signed in. The string should contain a
placeholder for the username with a call-to-action to logout, e.g. "Logout
({})".
eve... | Initialization | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
Shortcuts
gradio.LoginButton
Interface String Shortcut `"loginbutton"`
Initialization Uses default values
| Shortcuts | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
login_with_huggingface
| Demos | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton 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 LoginButton component supports the foll... | Event Listeners | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
ion: 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 the given
description. If None, the function's docstring will be used as the API
endpoint description. If False, then no description... | Event Listeners | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
um 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 preprocessing of component data before running 'fn'
(e.g. leaving it as a base64 string if this method is called with the `Image`
component).
... | Event Listeners | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
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
`Blocks.queue()`, which itself is 1 by default).
concurrency_id: str | None
default `= None`
If set, this is the id... | Event Listeners | https://gradio.app/docs/gradio/loginbutton | Gradio - Loginbutton Docs |
Accordion is a layout element which can be toggled to show/hide the
contained content.
| Description | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
with gr.Accordion("See Details"):
gr.Markdown("lorem ipsum")
| Example Usage | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
Parameters ▼
label: str | I18nData | None
default `= None`
name of accordion section.
open: bool
default `= True`
if True, accordion is open by default.
visible: bool | Literal['hidden']
default `= True`
elem_id: str | None
default `= None`
An optio... | Initialization | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
Methods | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs | |
%20Copyright%202022%20Fonticons,%20Inc.... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion 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%... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
onds 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[Component | BlockContext] | None
default `= None`
List of gradi... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
ion 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.
queue: bool
default `= True`
If True, will place the request ... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
enerators 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 `.change()`) would not allow any
submissions while an event is ... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
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 `= None`
A unique key for this event listener to be used i... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion 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.... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
esponds 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[Component | BlockContext] | None
default `= None`
List of gr... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
mation 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.
queue: bool
default `= True`
If True, will place the reque... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
r 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 `.change()`) would not allow any
submissions while an event ... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
ia 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 `= None`
A unique key for this event listener to be use... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion 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%... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
onds 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[Component | BlockContext] | None
default `= None`
List of gradi... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
ion 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.
queue: bool
default `= True`
If True, will place the request ... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
enerators 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 `.change()`) would not allow any
submissions while an event is ... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
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 `= None`
A unique key for this event listener to be used i... | expand | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion 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.... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
esponds 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[Component | BlockContext] | None
default `= None`
List of gr... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
mation 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.
queue: bool
default `= True`
If True, will place the reque... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
r 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 `.change()`) would not allow any
submissions while an event ... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
ia 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 `= None`
A unique key for this event listener to be use... | collapse | https://gradio.app/docs/gradio/accordion | Gradio - Accordion Docs |
Creates a color picker for user to select a color as string input. Can be
used as an input to pass a color value to a function or as an output to
display a color value.
| Description | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
**Using ColorPicker as an input component.**
How ColorPicker will pass its value to your function:
Type: `str | None`
Passes selected color value as a hex `str` into the function.
Example Code
import gradio as gr
def predict(
value: str | None
):
... | Behavior | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
Parameters ▼
value: str | Callable | None
default `= None`
default color hex code to provide in color picker. 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`
the l... | Initialization | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
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 than
min_width, the min_width parameter will be respected firs... | Initialization | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
ender()
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/colorpicker | Gradio - Colorpicker Docs |
Shortcuts
gradio.ColorPicker
Interface String Shortcut `"colorpicker"`
Initialization Uses default values
| Shortcuts | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
color_picker
| Demos | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker 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 ColorPicker component supports the foll... | Event Listeners | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
| BlockContext] | None
default `= None`
List of gradio.components to use as inputs. If the function takes no inputs,
this should be an empty list.
outputs: Component | BlockContext | list[Component | BlockContext] | Set[Component | BlockContext] | None
default `= None`
List of gradio.components to ... | Event Listeners | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
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.
batch: bool
default `= False`
If True, then the function shoul... | Event Listeners | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
e()`) would not allow any
submissions while an event is pending. If set to "multiple", unlimited
submissions are allowed while pending, and "always_last" (default for
`.change()` and `.key_up()` events) would allow a second submission after the
pending event is complete.
js: str | Literal[True] | None
... | Event Listeners | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
None`
A unique key for this event listener to be used in @gr.render(). If set, this
value identifies 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 ... | Event Listeners | https://gradio.app/docs/gradio/colorpicker | Gradio - Colorpicker Docs |
Server is the Gradio API engine exposed on a FastAPI application (Server
mode). It inherits from FastAPI, so all standard FastAPI methods (.get(),
.post(), .add_middleware(), .include_router(), etc.) work directly on this
instance.
New methods added on top of FastAPI: api(): Decorator to register a Gradio API
endpoin... | Description | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
from gradio import Server
app = Server()
@app.api(name="hello")
def hello(name: str) -> str:
return f"Hello {name}"
@app.get("/")
def root():
return {"message": "Hello World"}
app.launch()
| Example Usage | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
Parameters ▼
debug: bool
default `= False`
Enable debug mode for detailed error tracebacks.
title: str
default `= "FastAPI"`
The title of the API, shown in the OpenAPI docs.
summary: str | None
default `= None`
A short summary of the API.
description... | Initialization | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
ault `= None`
An async context manager for startup/shutdown lifecycle.
terms_of_service: str | None
default `= None`
URL to the terms of service.
contact: dict[str, Any] | None
default `= None`
Contact information dict for the API.
license_info: dict[str, Any] | None... | Initialization | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
server_app
| Demos | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
Methods | https://gradio.app/docs/gradio/server | Gradio - Server Docs | |
%20Copyright%202022%20Fonticons,%20Inc.... | api | https://gradio.app/docs/gradio/server | Gradio - Server 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.... | api | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
None`
concurrency_limit: int | None | Literal['default']
default `= "default"`
concurrency_id: str | None
default `= None`
queue: bool
default `= True`
batch: bool
default `= False`
max_batch_size: int
default `= 4`
api... | api | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | launch | https://gradio.app/docs/gradio/server | Gradio - Server 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%203... | launch | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
debug: bool
default `= False`
max_threads: int
default `= 40`
auth: Callable[[str, str], bool] | tuple[str, str] | list[tuple[str, str]] | None
default `= None`
auth_message: str | None
default `= None`
prevent_thread_lock: bool
default... | launch | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
itoring: bool | None
default `= None`
strict_cors: bool
default `= True`
node_server_name: str | None
default `= None`
node_port: int | None
default `= None`
ssr_mode: bool | None
default `= None`
pwa: bool | None
default `= None`
... | launch | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | api | https://gradio.app/docs/gradio/server | Gradio - Server 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.... | api | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
None`
concurrency_limit: int | None | Literal['default']
default `= "default"`
concurrency_id: str | None
default `= None`
queue: bool
default `= True`
batch: bool
default `= False`
max_batch_size: int
default `= 4`
api... | api | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
%20Copyright%202022%20Fonticons,%20Inc.... | launch | https://gradio.app/docs/gradio/server | Gradio - Server 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%203... | launch | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
debug: bool
default `= False`
max_threads: int
default `= 40`
auth: Callable[[str, str], bool] | tuple[str, str] | list[tuple[str, str]] | None
default `= None`
auth_message: str | None
default `= None`
prevent_thread_lock: bool
default... | launch | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
itoring: bool | None
default `= None`
strict_cors: bool
default `= True`
node_server_name: str | None
default `= None`
node_port: int | None
default `= None`
ssr_mode: bool | None
default `= None`
pwa: bool | None
default `= None`
... | launch | https://gradio.app/docs/gradio/server | Gradio - Server Docs |
A Gradio Interface includes a ‘Flag’ button that appears underneath the
output. By default, clicking on the Flag button sends the input and output
data back to the machine where the gradio demo is running, and saves it to a
CSV log file. But this default behavior can be changed. To set what happens
when the Flag button... | Description | https://gradio.app/docs/gradio/flagging | Gradio - Flagging Docs |
A simplified implementation of the FlaggingCallback abstract class provided
for illustrative purposes. Each flagged sample (both the input and output
data) is logged to a CSV file on the machine running the gradio app.
| Description | https://gradio.app/docs/gradio/flagging | Gradio - Flagging 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",
flagging_callback=SimpleCSVLogger())
CSVLogger
gradio.CSVLogger(···)
| Example Usage | https://gradio.app/docs/gradio/flagging | Gradio - Flagging Docs |
The default implementation of the FlaggingCallback abstract class in
gradio>=5.0. Each flagged sample (both the input and output data) is logged to
a CSV file with headers on the machine running the gradio app. Unlike
ClassicCSVLogger, this implementation is concurrent-safe and it creates a new
dataset file every time ... | Description | https://gradio.app/docs/gradio/flagging | Gradio - Flagging 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",
flagging_callback=CSVLogger())
| Example Usage | https://gradio.app/docs/gradio/flagging | Gradio - Flagging Docs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.