The Progress class provides a custom progress tracker that can be used in Gradio functions to display progress updates to users.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/gradio-app/gradio/llms.txt
Use this file to discover all available pages before exploring further.
Constructor
Parameters
If True, the Progress object will track any tqdm.tqdm iterations with the tqdm library in the function.
Methods
call
If float, should be between 0 and 1 representing completion. If tuple, first number represents steps completed, and second value represents total steps or None if unknown. If None, hides progress bar.
Description to display.
Estimated total number of steps.
Unit of iterations.
tqdm
Iterable to attach progress tracker to.
Description to display.
Estimated total number of steps.
Unit of iterations.
update
Number of steps completed.
Examples
Basic Progress
Progress with Steps
Progress with tqdm
Notes
- To attach a Progress tracker to a function, add a parameter right after the input parameters that has a default value set to a
gr.Progress()instance - The Progress tracker automatically appears in the Gradio UI when the function is running
- You can use either the functional style (calling
progress()) or the tqdm-like style (usingprogress.tqdm()) - Progress updates are displayed in real-time to users