m7mdal7aj commited on
Commit
398c0e8
1 Parent(s): e22f53a

Update my_model/captioner/image_captioning.py

Browse files
my_model/captioner/image_captioning.py CHANGED
@@ -29,6 +29,10 @@ class ImageCaptioningModel:
29
 
30
 
31
  def load_model(self):
 
 
 
 
32
  if self.model_type == 'i_blip':
33
  self.processor = InstructBlipProcessor.from_pretrained(self.model_path,
34
  load_in_8bit=self.load_in_8bit,
 
29
 
30
 
31
  def load_model(self):
32
+
33
+ if self.load_in_4bit and self.load_in_8bit: # check if in case both set to True by mistake.
34
+ self.load_in_4bit = False
35
+
36
  if self.model_type == 'i_blip':
37
  self.processor = InstructBlipProcessor.from_pretrained(self.model_path,
38
  load_in_8bit=self.load_in_8bit,