`python -OO -c 'import transformers.pipelines'` crashes
Author: TimDarcet
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 4.56.0
- Platform: Linux-6.5.13-65-650-3434-22042-coreweave-amd64-3-x86_64-with-glibc2.35
- Python version: 3.11.13
- Huggingface_hub version: 0.34.4
- Safetensors version: 0.6.2
- Accelerate version: 1.10.1
- Accelerate config: 	not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.8.0+cu128 (CUDA)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: no
- Using GPU in script?: no
- GPU type: NVIDIA H100 80GB HBM3



### Who can help?

@Rocketknight1 @stevhliu

### Information

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

### Tasks

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

### Reproduction

run `python -OO -c 'import transformers.pipelines'`

Output:
```
❯ python -OO -c 'import transformers.pipelines'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/pipelines/__init__.py", line 81, in <module>
    from .text_to_audio import TextToAudioPipeline
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/pipelines/text_to_audio.py", line 25, in <module>
    from ..models.speecht5.modeling_speecht5 import SpeechT5HifiGan
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/models/speecht5/modeling_speecht5.py", line 32, in <module>
    from ...modeling_layers import GradientCheckpointingLayer
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/modeling_layers.py", line 98, in <module>
    class GenericForSequenceClassification(object):
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/modeling_layers.py", line 112, in GenericForSequenceClassification
    @auto_docstring
     ^^^^^^^^^^^^^^
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/utils/auto_docstring.py", line 2048, in auto_docstring
    return auto_docstring_decorator(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/utils/auto_docstring.py", line 2041, in auto_docstring_decorator
    return auto_method_docstring(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/utils/auto_docstring.py", line 1751, in auto_method_docstring
    return_docstring, func_documentation = _process_returns_section(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/utils/auto_docstring.py", line 1620, in _process_returns_section
    return_docstring = _prepare_output_docstrings(return_annotation, config_class, add_intro=add_intro)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/storage/home/timdarcet/envs/250902_amaia_test/lib/python3.11/site-packages/transformers/utils/doc.py", line 155, in _prepare_output_docstrings
    raise ValueError(
ValueError: No `Args` or `Parameters` section is found in the docstring of `SequenceClassifierOutputWithPast`. Make sure it has docstring and contain either `Args` or `Parameters`.
```


python -OO removes docstrings, making the decorator crash

### Expected behavior

not crashing

Comments:
Hi @TimDarcet, we generally do not support `-OO`! It's not the same as `-O2` in `gcc` at all; the speedup from it is almost nonexistent, but it's hugely breaking in a lot of cases.

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/main/CONTRIBUTING.md) are likely to be ignored.