myownskyW7 commited on
Commit
4c121de
1 Parent(s): c06549a

Upload modeling_vit.py

Browse files
Files changed (1) hide show
  1. modeling_vit.py +6 -6
modeling_vit.py CHANGED
@@ -518,12 +518,12 @@ def create_eva_vit_g(img_size=224,
518
  norm_layer=partial(nn.LayerNorm, eps=1e-6),
519
  use_checkpoint=use_checkpoint,
520
  )
521
- url = "https://storage.googleapis.com/sfr-vision-language-research/LAVIS/models/BLIP2/eva_vit_g.pth"
522
- cached_file = download_cached_file(url, check_hash=False, progress=True)
523
- state_dict = torch.load(cached_file, map_location="cpu")
524
- interpolate_pos_embed(model, state_dict)
525
-
526
- incompatible_keys = model.load_state_dict(state_dict, strict=False)
527
 
528
  if precision == "fp16":
529
  convert_weights_to_fp16(model)
 
518
  norm_layer=partial(nn.LayerNorm, eps=1e-6),
519
  use_checkpoint=use_checkpoint,
520
  )
521
+ # url = "https://storage.googleapis.com/sfr-vision-language-research/LAVIS/models/BLIP2/eva_vit_g.pth"
522
+ # cached_file = download_cached_file(url, check_hash=False, progress=True)
523
+ # state_dict = torch.load(cached_file, map_location="cpu")
524
+ # interpolate_pos_embed(model, state_dict)
525
+ #
526
+ # incompatible_keys = model.load_state_dict(state_dict, strict=False)
527
 
528
  if precision == "fp16":
529
  convert_weights_to_fp16(model)