模型加载报错
今天下午加载模型突然报错了,之前都没问题的
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen2.5-VL-3B-Instruct",
torch_dtype=torch.float16, # or "auto"
device_map="auto",
trust_remote_code=True
)
processor = AutoProcessor.from_pretrained(
"Qwen/Qwen2.5-VL-3B-Instruct",
trust_remote_code=True
)
ValueError: Could not find Qwen2_5_VLVideoProcessor neither in <module 'transformers.models.qwen2_5_vl' from '/usr/local/lib/python3.10/dist-packages/transformers/models/qwen2_5_vl/__init__.py'> nor in <module 'transformers' from '/usr/local/lib/python3.10/dist-packages/transformers/__init__.py'>!
pip install qwen-vl-utils[decord]==0.0.8 solved it for me