AutoModel does not support Qwen3VLMoE
Author: AylinAkkus
Pull request: no
Labels: name: bug

### System Info

- `transformers` version: 5.0.0.dev0
- Platform: Linux-5.14.0-570.42.2.el9_6.x86_64-x86_64-with-glibc2.34
- Python version: 3.10.18
- Huggingface_hub version: 1.0.0.rc6
- Safetensors version: 0.5.3
- Accelerate version: 1.10.1
- Accelerate config:    not found
- DeepSpeed version: 0.18.0
- PyTorch version (accelerator?): 2.8.0+cu128 (CUDA)
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: Quadro RTX 8000

### Who can help?

_No response_

### Information

- [x] 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

AutoModel does not correctly load a model of type Qwen3VLMoeModel despite downloading the latest version via:

`pip install git+https://github.com/huggingface/transformers/.git`

```
from transformers import AutoModel, AutoProcessor

MODEL_PATH = "Qwen/Qwen3-VL-30B-A3B-Instruct"

model = AutoModel.from_pretrained(
    MODEL_PATH
)
```
This doesn't work, however the following works:

```
from transformers import Qwen3VLMoeForConditionalGeneration, AutoProcessor

MODEL_PATH = "Qwen/Qwen3-VL-30B-A3B-Instruct"

model = Qwen3VLMoeForConditionalGeneration.from_pretrained(
    MODEL_PATH
)
```

### Expected behavior

I would expect the model to load, however I get this:

```
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████| 13/13 [00:00<00:00, 470.76it/s]
Some weights of Qwen3VLMoeModel were not initialized from the model checkpoint at Qwen/Qwen3-VL-30B-A3B-Instruct and are newly initialized: ['language_model.embed_tokens.weight', 'language_model.layers.{0...47}.input_layernorm.weight', 'language_model.layers.{0...47}.mlp.experts.down_proj', 'language_model.layers.{0...47}.mlp.experts.gate_up_proj', 'language_model.layers.{0...47}.mlp.gate.weight', 'language_model.layers.{0...47}.post_attention_layernorm.weight', 'language_model.layers.{0...47}.self_attn.k_norm.weight', 'language_model.layers.{0...47}.self_attn.k_proj.weight', 'language_model.layers.{0...47}.self_attn.o_proj.weight', 'language_model.layers.{0...47}.self_attn.q_norm.weight', 'language_model.layers.{0...47}.self_attn.q_proj.weight', 'language_model.layers.{0...47}.self_attn.v_proj.weight', 'language_model.norm.weight', 'visual.blocks.{0...26}.attn.proj.bias', 'visual.blocks.{0...26}.attn.proj.weight', 'visual.blocks.{0...26}.attn.qkv.bias', 'visual.blocks.{0...26}.attn.qkv.weight', 'visual.blocks.{0...26}.mlp.linear_f.{1, 2}.bias', 'visual.blocks.{0...26}.mlp.linear_f.{1, 2}.weight', 'visual.blocks.{0...26}.nor.{1, 2}.bias', 'visual.blocks.{0...26}.nor.{1, 2}.weight', 'visual.deepstack_merger_list.{0, 1, 2}.linear_f.{1, 2}.bias', 'visual.deepstack_merger_list.{0, 1, 2}.linear_f.{1, 2}.weight', 'visual.deepstack_merger_list.{0, 1, 2}.norm.bias', 'visual.deepstack_merger_list.{0, 1, 2}.norm.weight', 'visual.merger.linear_f.{1, 2}.bias', 'visual.merger.linear_f.{1, 2}.weight', 'visual.merger.norm.bias', 'visual.merger.norm.weight', 'visual.patch_embed.proj.bias', 'visual.patch_embed.proj.weight', 'visual.pos_embed.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
```

Comments:
Yeah, it seems like there's some issue with layer naming for the base model, probably just an incorrect prefix somewhere! cc @zucchini-nlp 

Yep, it is the `base_model_prefix` which is not set correctly, fixing now

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.

Fixed on main, closing as resolved