HF-Pawan commited on
Commit
94efef4
·
1 Parent(s): 875832c

Style Changes

Browse files
Files changed (1) hide show
  1. core/model_loader.py +5 -7
core/model_loader.py CHANGED
@@ -15,12 +15,11 @@ PROMPTS = {
15
  }
16
 
17
  def load_model():
18
- # processor = BlipProcessor.from_pretrained(MODEL_ID)
19
- # model = BlipForConditionalGeneration.from_pretrained(MODEL_ID)
20
- # model.to(DEVICE)
21
- # model.eval()
22
- # return model, processor
23
- return None, None
24
 
25
  def generate_caption(
26
  model,
@@ -28,7 +27,6 @@ def generate_caption(
28
  image,
29
  style
30
  ):
31
- return "Dummay Text"
32
  prompt = PROMPTS.get(style, "this image shows")
33
 
34
  inputs = processor(
 
15
  }
16
 
17
  def load_model():
18
+ processor = BlipProcessor.from_pretrained(MODEL_ID)
19
+ model = BlipForConditionalGeneration.from_pretrained(MODEL_ID)
20
+ model.to(DEVICE)
21
+ model.eval()
22
+ return model, processor
 
23
 
24
  def generate_caption(
25
  model,
 
27
  image,
28
  style
29
  ):
 
30
  prompt = PROMPTS.get(style, "this image shows")
31
 
32
  inputs = processor(