sourabhbargi11 commited on
Commit
1af1fd7
·
verified ·
1 Parent(s): fb4021d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -40,10 +40,10 @@ def image_preprocess(image):
40
  return image
41
 
42
  def generate_caption(processor, model, device, image):
43
- #inputs = processor(image, return_tensors='pt').to(device)
44
- #out = model.generate(**inputs, max_new_tokens=20)
45
- #caption = processor.decode(out[0], skip_special_tokens=True)
46
- caption="im here "
47
  return caption
48
 
49
  def main():
 
40
  return image
41
 
42
  def generate_caption(processor, model, device, image):
43
+ inputs = image_processor (image, return_tensors='pt').to(device)
44
+ out = model.generate(**inputs, max_new_tokens=20)
45
+ caption = processor.decode(out[0], skip_special_tokens=True)
46
+ #caption="im here "
47
  return caption
48
 
49
  def main():