diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6eeded1 Binary files /dev/null and b/.DS_Store differ diff --git a/InternVideo2/.DS_Store b/InternVideo2/.DS_Store new file mode 100644 index 0000000..aca79d1 Binary files /dev/null and b/InternVideo2/.DS_Store differ diff --git a/InternVideo2/multi_modality/models/internvideo2_clip.py b/InternVideo2/multi_modality/models/internvideo2_clip.py index 45a465c..299ab63 100644 --- a/InternVideo2/multi_modality/models/internvideo2_clip.py +++ b/InternVideo2/multi_modality/models/internvideo2_clip.py @@ -228,12 +228,14 @@ def load_checkpoint(self, vision_ckpt_path=None, text_ckpt_path=None, extra_ckpt # load text_encoder logger.info(f"Load text_encoder checkpoint from {text_ckpt_path}") - test_ckpt = torch.load(text_ckpt_path, map_location='cpu') - if 'module' in test_ckpt.keys(): - test_ckpt = test_ckpt['module'] - for k, v in test_ckpt.items(): + text_ckpt = torch.load(text_ckpt_path, map_location='cpu') + if 'module' in text_ckpt.keys(): + text_ckpt = text_ckpt['module'] + for k, v in text_ckpt.items(): if k.startswith('transformer.') or k == 'text_projection': new_k = "text_encoder." + k + if ("q_proj" in k or "v_proj" in k) and "lora" not in k: + new_k = new_k.replace("_proj.", "_proj.base_layer.") else: continue new_ckpt[new_k] = v