# Progress

```python
gradio.Progress(···)
```

### Description

The Progress class provides a custom progress tracker that is used in a function signature. To attach a Progress tracker to a function, simply add a parameter right after the input parameters that has a default value set to a `gradio.Progress()` instance. The Progress tracker can then be updated in the function by calling the Progress object or using the `tqdm` method on an Iterable.

### Example Usage

```python
import gradio as gr
import time
def my_function(x, progress=gr.Progress()):
    progress(0, desc="Starting...")
    time.sleep(1)
    for i in progress.tqdm(range(100)):
        time.sleep(0.1)
    return x
gr.Interface(my_function, gr.Textbox(), gr.Textbox()).queue().launch()
```

### Initialization

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `track_tqdm` | `bool` | `False` | If True, the Progress object will track any tqdm.tqdm iterations with the tqdm library in the function. |
### Methods

#### 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 `Progress` component supports the following event listeners:

- `Progress.__call__(fn, ...)`: Updates progress tracker with progress and message text.
- `Progress.tqdm(fn, ...)`: Attaches progress tracker to iterable, like tqdm.

#### Event Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `progress` | `float \| tuple[int, int \| None] \| None` | `` | 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. |
| `desc` | `str \| None` | `None` | description to display. |
| `total` | `int \| float \| None` | `None` | estimated total number of steps. |
| `unit` | `str` | `"steps"` | unit of iterations. |
- [Progress Bars](https://www.gradio.app/guides/progress-bars/)
