Custom Components GalleryNEW
ExploreCustom Components GalleryNEW
ExploreNew 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/a26030d1fa39ffc75ce53d4285caa98eeb1dc13a/gradio-4.32.1-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
gradio_client.Job(···)
Parameter | Description |
---|---|
future Future required | The future object that represents the prediction call, created by the Client.submit() method |
communicator Communicator | None default: None | The communicator object that is used to communicate between the client and the background thread running the job |
verbose bool default: True | Whether to print any status-related messages to the console |
space_id str | None default: None | The space ID corresponding to the Client object that created this Job object |
Event listeners allow you to capture and 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.
The Job component supports the following event listeners. Each event listener takes the same parameters, which are listed in the Event Arguments table below.
Listener | Description |
---|---|
| Return the result of the call that the future represents. Raises CancelledError: If the future was cancelled, TimeoutError: If the future didn't finish executing before the given timeout, and Exception: If the call raised then that exception will be raised. <br> |
| Returns a list containing the latest outputs from the Job. <br> If the endpoint has multiple output components, the list will contain a tuple of results. Otherwise, it will contain the results without storing them in tuples. <br> For endpoints that are queued, this list will contain the final job output even if that endpoint does not use a generator function. <br> |
| Returns the latest status update from the Job in the form of a StatusUpdate object, which contains the following fields: code, rank, queue_size, success, time, eta, and progress_data. <br> progress_data is a list of updates emitted by the gr.Progress() tracker of the event handler. Each element of the list has the following fields: index, length, unit, progress, desc. If the event handler does not have a gr.Progress() tracker, the progress_data field will be None. <br> |
Parameter | Description |
---|---|
timeout float | None default: None | The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time. |