load issue
im appreciate that model, but here i follow the model card with loading the model then got some issue,i load it with regular transformers :
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "/content/NuExtract-2-8B"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True, padding_side='left')
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True,
torch_dtype=torch.bfloat16,
attn_implementation="flash_attention_2" # we recommend using flash attention
).to("cuda")
erro:
ValueError: The model class you are passing has a config_class
attribute that is not consistent with the config class you passed (model has <class 'transformers_modules.OpenGVLab.InternVL2_5-8B-MPO.232b9f9f753ae4cd21df1c0d1f8af76f84398336.configuration_internvl_chat.InternVLChatConfig'> and you passed <class 'transformers_modules.NuExtract-2-8B.configuration_internvl_chat.InternVLChatConfig'>. Fix one of those so they match!
Try updating transformers.
i had try it,but it still dosen't work ,my transformers version is 4.50
Can you try with the stable release (4.49.0)?
same issue as well
problem has fix up ,just upgrade the transfomers ,and don't forget :
pip install flash-attn --no-build-isolation