Closed harrytrolor closed 5 months ago
This was an oversight on our part and the 'xmodel_32000.model' has already been uploaded on huggingface
@New-Star-HLP Thanks a lot , I continued to run the inference.py and I changed the clip to siglip ,And I got another problem,I thought It was the different structure between them at first, but it still raised the same error after I changed Clip back.How should I fix it. By the way , what should I do to ues siglip or I just have to change the name and path?
Traceback (most recent call last): File "/media/hubble/E01EEDCB1EED9B34/XmodelVLM-main/inference.py", line 83, in <module> inference_once(args) File "/media/hubble/E01EEDCB1EED9B34/XmodelVLM-main/inference.py", line 21, in inference_once tokenizer, model, image_processor, context_len = load_pretrained_model(args.model_path, args.load_8bit, args.load_4bit) File "/media/hubble/E01EEDCB1EED9B34/XmodelVLM-main/xmodelvlm/model/xmodelvlm.py", line 330, in load_pretrained_model model = XmodelLMForCausalLM.from_pretrained(model_path, trust_remote_code=True, low_cpu_mem_usage=True, **kwargs) File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3850, in from_pretrained ) = cls._load_pretrained_model( File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4284, in _load_pretrained_model new_error_msgs, offload_index, state_dict_index = _load_state_dict_into_meta_model( File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/transformers/modeling_utils.py", line 805, in _load_state_dict_into_meta_model set_module_tensor_to_device(model, param_name, param_device, **set_module_kwargs) File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/accelerate/utils/modeling.py", line 345, in set_module_tensor_to_device raise ValueError( ValueError: Trying to set a tensor of shape torch.Size([2048, 1024]) in "weight" (which has shape torch.Size([2048, 4096])), this look incorrect.
@New-Star-HLP Thanks. But it seems that some other components remain incorrect after I update the vision_projector.py . Still the same error but the detailed shape size has changed
Traceback (most recent call last): File "/media/hubble/E01EEDCB1EED9B34/XmodelVLM-main/inference.py", line 83, in <module> inference_once(args) File "/media/hubble/E01EEDCB1EED9B34/XmodelVLM-main/inference.py", line 21, in inference_once tokenizer, model, image_processor, context_len = load_pretrained_model(args.model_path, args.load_8bit, args.load_4bit) File "/media/hubble/E01EEDCB1EED9B34/XmodelVLM-main/xmodelvlm/model/xmodelvlm.py", line 330, in load_pretrained_model model = XmodelLMForCausalLM.from_pretrained(model_path, trust_remote_code=True, low_cpu_mem_usage=True, **kwargs) File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3850, in from_pretrained ) = cls._load_pretrained_model( File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4284, in _load_pretrained_model new_error_msgs, offload_index, state_dict_index = _load_state_dict_into_meta_model( File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/transformers/modeling_utils.py", line 805, in _load_state_dict_into_meta_model set_module_tensor_to_device(model, param_name, param_device, **set_module_kwargs) File "/home/hubble/anaconda3/envs/xmodelvlm/lib/python3.10/site-packages/accelerate/utils/modeling.py", line 345, in set_module_tensor_to_device raise ValueError( ValueError: Trying to set a tensor of shape torch.Size([577, 1024]) in "weight" (which has shape torch.Size([257, 1024])), this look incorrect.
Thanks for the feedback, I suggest you update vision_projector.py and huggingface. Finally I have verified that there should be no errors.
hi,I have the problem when I tried to run the inference.py ? It seems that the vocab_file load is wrong ,how can I fix it? by the way, I see the parameters VOCAB_FILES_NAMES = {"vocab_file": "xmodel_32000.model"},what does xmodel_32000 mean?because I didnot find it in the code, making me a bit confused
Errors about the first question: