Add tqdm to pipeline
# 🚀 Feature request

Pipeline can process a list of inputs but doesn't print out progress. If the input list is large, it's difficult to tell whether the pipeline is running fine or gets stuck. Add tqdm to the generation loop to show progress.

For example, if I add tqdm to /src/transformers/pipelines/base.py line 1086, then I can see text generation progress. But I don't know how to add such a feature to all paths.

**from tqdm import tqdm**
....
if self.framework == "pt":
    final_iterator = self.get_iterator(
        inputs, num_workers, batch_size, preprocess_params, forward_params, postprocess_params
    )
    outputs = [output for output in **tqdm**(final_iterator)]
    return outputs

Generation progress would show in stdout:

Process 0, Generate starts: Wed Dec 15 12:27:42 2021
  2%|█▊                                                                                             | 2/92 [00:17<13:01,  8.68s/it]
Yeah that would be quite nice! cc @Narsil <|||||>Hi @dunalduck0 ,

If you use a `Dataset` instead of a list, it will work.

```python
dataset = MyDataset()

for out in tqdm.tqdm(pipe(dataset)):
    print(out)
```

And converting a raw list to a dataset is relatively easy

```python
class ListDataset(Dataset):
     def __init__(self, original_list)
        self.original_list = original_list

    def __len__(self):
        return len(self.original_list)

    def __getitem__(self, i):
        return self.original_list[i]
```
This helper could live in transformers pipelines utils for sure.

The problem with doing what you suggest is:

- tqdm needs a special command when running in notebooks (not something we should handle IMO)
- `List` existed previously so we need to return a `list` for backward compatibility reasons. That means the pipeline needs to consume and recreate the list, meaning adding tqdm inside is not desirable IMHO (or supporting it by adding special arguments).

My personal take would be to not break backward compatibility for lists, but encourage instead to use iterator enabling user code to decide if they want something like `tqdm` or any other solution (also tweaking all the arguments of `tqdm` like the name of the loop so on and so forth).
The helper to transform the `list` into a `Dataset` is already something (and might cover other frameworks too which is something we have in mind)


<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.