import torch org_state_dict = torch.load("/home/cv/sxp/llava_new/llava/qwen_clip/pytorch_model.bin",map_location="cuda:1") new_state_dict = {} for key,value in org_state_dict.items(): if "attn_pool" not in key: new_state_dict[key] = value print(new_state_dict.keys()) torch.save(new_state_dict,"/home/cv/sxp/llava_new/llava/qwen_clip/pytorch_model_new.bin")