cardcounter commited on
Commit
d493008
1 Parent(s): 4aa81f2

Update build_mlp.py

Browse files

To support transformers 4.44.0
According to :
https://github.com/InternLM/InternLM-XComposer/issues/335
https://github.com/InternLM/InternLM-XComposer/issues/389

Files changed (1) hide show
  1. build_mlp.py +1 -1
build_mlp.py CHANGED
@@ -59,7 +59,7 @@ class CLIPVisionTower(nn.Module):
59
  def load_model(self):
60
  self.vision_tower = CLIPVisionModel.from_pretrained(self.vision_tower_name)
61
  self.vision_tower.requires_grad_(False)
62
-
63
  self.is_loaded = True
64
 
65
  def resize_pos(self):
 
59
  def load_model(self):
60
  self.vision_tower = CLIPVisionModel.from_pretrained(self.vision_tower_name)
61
  self.vision_tower.requires_grad_(False)
62
+ self.vision_tower.gradient_checkpointing_enable({"use_reentrant": "True"})
63
  self.is_loaded = True
64
 
65
  def resize_pos(self):