"You seem to be using the pipelines sequentially on GPU." warning results in "TypeError: not all arguments converted during string formatting"
Author: GuyPaddock
Pull request: no
Labels: name: Good First Issue

name: bug

### System Info

Copy-and-paste the text below in your GitHub issue and FILL OUT the two last points.

- `transformers` version: 4.39.3
- Platform: Linux-6.6.38-gentoo-gep-x86_64-Intel-R-_Xeon-R-_CPU_E5-2698_v3_@_2.30GHz-with-glibc2.39
- Python version: 3.10.14
- Huggingface_hub version: 0.20.3
- Safetensors version: 0.4.3
- Accelerate version: not installed
- Accelerate config: not found
- PyTorch version (GPU?): 2.1.2+cu121 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: Yes. https://github.com/MahmoudAshraf97/whisper-diarization/blob/main/diarize.py
- Using distributed or parallel set-up in script?: No.

### Who can help?

@Narsil

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

Invoke the `Pipeline` constructor 10 or more times in the same script.

The script will crash with a `TypeError` having the message: "not all arguments converted during string formatting".

Stack:
```
--- Logging error ---
Traceback (most recent call last):
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/logging/__init__.py", line 1100, in emit
    msg = self.format(record)
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/logging/__init__.py", line 943, in format
    return fmt.format(record)
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/logging/__init__.py", line 678, in format
    record.message = record.getMessage()
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/logging/__init__.py", line 368, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/mnt/array1/home/guyep/playground/whisper-diarization/diarize_parallel.py", line 183, in <module>
    labled_words = punct_model.predict(words_list, chunk_size=230)
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/site-packages/deepmultilingualpunctuation/punctuationmodel.py", line 47, in predict
    result = self.pipe(text)
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/site-packages/transformers/pipelines/token_classification.py", line 248, in __call__
    return super().__call__(inputs, **kwargs)
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1167, in __call__
    logger.warning_once(
  File "/mnt/array1/home/guyep/miniconda3/envs/whisper-diarization/lib/python3.10/site-packages/transformers/utils/logging.py", line 329, in warning_once
    self.warning(*args, **kwargs)
Message: 'You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset'
Arguments: (<class 'UserWarning'>,)
```

It seems like the `UserWarning` object is being passed into the message format operator.

### Expected behavior

* The warning message `You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset` should be emitted.
* Script should not crash.

Comments:
Thanks for the issue @GuyPaddock! 

cc @Rocketknight1 if you have the bandwidth to check that. Thanks!

Adding a Good First Issue label as it's likely a simple fix!

Hi @GuyPaddock, this should already be fixed if you upgrade your version of transformers with `pip install --upgrade transformers`! Feel free to reopen the issue if that doesn't work for you.