Skip to content

Llava vision_tower monkey patch generates hidden_states=None #1011

@Tcc0403

Description

@Tcc0403

🐛 Describe the bug

        # If we have one vision feature layer, return the corresponding hidden states,
        # otherwise, select the hidden states of each feature layer and concatenate them
        if isinstance(vision_feature_layer, int):
>           selected_image_feature = image_outputs.hidden_states[vision_feature_layer]
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           TypeError: 'NoneType' object is not subscriptable

.venv/lib/python3.13/site-packages/transformers/models/llava/modeling_llava.py:192: TypeError

Reproduce

Run the following command

python -m pytest test/convergence/bf16/test_mini_models_multimodal.py -k llava

Versions

Python version: 3.13.1
Liger Kernel version: 0.6.4
PyTorch version: 2.7.1+cu126
CUDA version: 12.6
HIP(ROCm) version: Not available
Triton version: 3.3.1
Transformers version: 5.0.0rc2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions