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.

!pip install git+https://github.com/huggingface/[email protected]

Collecting tokenizers<0.22,>=0.21 (from transformers==4.50.0.dev0)
Downloading tokenizers-0.21.0.tar.gz (343 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> [2 lines of output]
ERROR: Could not find a version that satisfies the requirement puccinialin (from versions: none)
ERROR: No matching distribution found for puccinialin
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Loading model 'HuggingFaceTB/SmolVLM2-500M-Video-Instruct' …
transformers version: 4.46.3
Trying direct remote-code load…
The checkpoint you are trying to load has model type smolvlm but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

Sign up or log in to comment