Qwen2-VL and Qwen2.5-VL have no _name_or_path in transformers v4.57.5
Author: albertvillanova
Pull request: no
Labels: name: bug

Qwen2-VL and Qwen2.5-VL have no `_name_or_path` in transformers v4.57.5.

Maybe it is caused because the release includes this PR:
- https://github.com/huggingface/transformers/pull/41808

but does not include the related PR:
- https://github.com/huggingface/transformers/pull/41758

The absence of the latter could potentially explain the observed behavior.

See related comments in TRL:
- https://github.com/huggingface/trl/issues/4829#issuecomment-3755470451

### System Info

- `transformers` version: 4.57.5
- Platform: Linux-5.15.0-164-generic-x86_64-with-glibc2.31
- Python version: 3.12.9
- Huggingface_hub version: 0.36.0
- Safetensors version: 0.6.2
- Accelerate version: 1.4.0
- Accelerate config: 	not found
- DeepSpeed version: not installed
- PyTorch version (accelerator?): 2.8.0+cu128 (NA)
- 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?: <fill in>

### Who can help?

@zucchini-nlp, who created both PRs
@vasqu, who made the release https://github.com/huggingface/transformers/releases/tag/v4.57.5

### 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

```python
from transformers import AutoConfig

for model_id in ["Qwen/Qwen2-VL-2B", "Qwen/Qwen2.5-VL-3B-Instruct"]:
    config = AutoConfig.from_pretrained(model_id)
    print()
    print(model_id)
    print(f"{config._name_or_path=}")
    print(f"{config.text_config._name_or_path=}")
```
gives
```python
Qwen/Qwen2-VL-2B
config._name_or_path=''
config.text_config._name_or_path=''

Qwen/Qwen2.5-VL-3B-Instruct
config._name_or_path=''
config.text_config._name_or_path=''
```

### Expected behavior

It should give:
```python
Qwen/Qwen2-VL-2B
config._name_or_path='Qwen/Qwen2-VL-2B'
config.text_config._name_or_path=''

Qwen/Qwen2.5-VL-3B-Instruct
config._name_or_path='Qwen/Qwen2.5-VL-3B-Instruct'
config.text_config._name_or_path=''
```

Comments:
Oh no, I was assuming this whole time that the related PR is included in 4.57.0 release 🤦🏻 . Can you verify that adding the missing PR solves the issue for you?

Confirmed @zucchini-nlp: after cherry-picking the missing PR commit into the v4.57.5 branch, our CI is green: https://github.com/huggingface/trl/actions/runs/21040049805/job/60499032775
```python
 Installed 2 packages in 277ms
 - transformers==4.57.5
 + transformers==4.57.5 (from git+https://github.com/albertvillanova/transformers@34ee2bbd9613d0d07615783b6a81a064ce90841d)
```

Wrong pings (poor vaqu and vascu) 😭 let me check internally if we do another patch release tomorrow then

Sorry about this, patches have been really messy due to it being such a long time + transition to v5 

Sorry for the wrong pins! I corrected them. 😅 

And no worries at all, thanks for checking internally! 🤗 

Thanks, and looking forward to your update. On our side, proper support for Qwen2-VL and Qwen2.5-VL in transformers-4.57.5 is currently blocking a few follow-up PRs for our CI: reverting the transformers pinning and removing the explicit `_name_or_path` from our CI tiny models.

We'll wait for your update and can proceed as soon as the patch is available. Thanks again!

Patch is out at https://github.com/huggingface/transformers/releases/tag/v4.57.6

Can close the issues now, i think