ValueError: The checkpoint you are trying to load has model type `smolvlm` but Transformers does not recognize this architecture.

#13
by shaileshsarda - opened

image.png

@shaileshsarda make sure to install the latest transformers:
!pip install git+https://github.com/huggingface/[email protected]

thank you!

Thank You!

torch=2.4.0+cu118,flash_attn-2.6.2+cu118torch2.4cxx11abiTRUE-cp312-cp312-linux_x86_64.whl+python3.12
git clone https://github.com/huggingface/transformers.git
cd transformers
git checkout v4.49.0-SmolVLM-2
pip install -e .
I have this problem too, have you solved it?

!pip install git+https://github.com/huggingface/[email protected]
from transformers import AutoProcessor, AutoModelForImageTextToText
import torch

model_path = "HuggingFaceTB/SmolVLM2-500M-Video-Instruct"
processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForImageTextToText.from_pretrained(
model_path,
torch_dtype=torch.bfloat16,
_attn_implementation="flash_attention_2"
).to("cuda")

ImportError Traceback (most recent call last)
/tmp/ipython-input-28-2175807590.py in <cell line: 0>()
----> 1 from transformers import AutoProcessor, AutoModelForImageTextToText
2 import torch
3
4 model_path = "HuggingFaceTB/SmolVLM2-500M-Video-Instruct"
5 processor = AutoProcessor.from_pretrained(model_path)

ImportError: cannot import name 'AutoProcessor' from 'transformers' (unknown location)


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

Sign up or log in to comment