Help with loading the adapter.

#1
by empowerus - opened

Hi Merve,
I am getting this error in both code from the model card and nb. Can you please suggest what how I can fix it .

!pip install -q git+https://github.com/andimarafioti/transformers.git@idefics3

from transformers import Idefics3ForConditionalGeneration, AutoProcessor

peft_model_id = "merve/idefics3llama-vqav2"
base_model_id = "HuggingFaceM4/Idefics3-8B-Llama3"
processor = AutoProcessor.from_pretrained(base_model_id)
model = Idefics3ForConditionalGeneration.from_pretrained(base_model_id)
model.load_adapter(peft_model_id).to("cuda")

Loading checkpoint shards: 100%
 4/4 [01:00<00:00, 12.17s/it]

AttributeError Traceback (most recent call last)
in <cell line: 7>()
5 processor = AutoProcessor.from_pretrained(base_model_id)
6 model = Idefics3ForConditionalGeneration.from_pretrained(base_model_id)
----> 7 model.load_adapter(peft_model_id).to("cuda")

AttributeError: 'NoneType' object has no attribute 'to'

Owner

@empowerus there are some changes to codebase, can you checkout to that branch and then checkout to this commit and pip install that? e1b7c0a05ab65e4ddb62a407fe12f8ec13a916f0

Sign up or log in to comment