tttoaster commited on
Commit
53284ee
1 Parent(s): ac31431

Update src/models/tokenizer/qwen_visual.py

Browse files
src/models/tokenizer/qwen_visual.py CHANGED
@@ -18,7 +18,7 @@ from torch.nn import functional as F
18
  from torch.nn.init import trunc_normal_
19
  from torchvision import transforms
20
  from torchvision.transforms import InterpolationMode
21
- from src.models.mllm.utils import load_zero3_checkpoint
22
 
23
 
24
  def get_abs_pos(abs_pos, tgt_size):
@@ -450,8 +450,8 @@ class VisionTransformerWithAttnPool(nn.Module):
450
  if pretrained_model_path is not None:
451
  print('Load ckpt of qwen visual encoder')
452
  ckpt = torch.load(pretrained_model_path, map_location='cpu')
453
- # missing, unexpected = model.load_state_dict(ckpt, strict=False)
454
- load_zero3_checkpoint(model, ckpt)
455
  # print('Load ckpt of qwen visual encoder')
456
  # print('missing keys: ', len(missing), 'unexpected keys:', len(unexpected))
457
 
 
18
  from torch.nn.init import trunc_normal_
19
  from torchvision import transforms
20
  from torchvision.transforms import InterpolationMode
21
+ #from src.models.mllm.utils import load_zero3_checkpoint
22
 
23
 
24
  def get_abs_pos(abs_pos, tgt_size):
 
450
  if pretrained_model_path is not None:
451
  print('Load ckpt of qwen visual encoder')
452
  ckpt = torch.load(pretrained_model_path, map_location='cpu')
453
+ missing, unexpected = model.load_state_dict(ckpt, strict=False)
454
+ #load_zero3_checkpoint(model, ckpt)
455
  # print('Load ckpt of qwen visual encoder')
456
  # print('missing keys: ', len(missing), 'unexpected keys:', len(unexpected))
457