anand004 commited on
Commit
fa7f40f
·
verified ·
1 Parent(s): a155ca8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -62,11 +62,11 @@ def get_image_description(image):
62
  gc.collect()
63
 
64
  prompt = "[INST] <image>\nDescribe the image in a sentence [/INST]"
65
- n = len(prompt)
66
 
67
  inputs = processor(prompt, image, return_tensors="pt").to("cuda:0")
68
  output = vision_model.generate(**inputs, max_new_tokens=100)
69
- return (processor.decode(output[0][n:], skip_special_tokens=True))
70
 
71
 
72
  CSS = """
 
62
  gc.collect()
63
 
64
  prompt = "[INST] <image>\nDescribe the image in a sentence [/INST]"
65
+ # n = len(prompt)
66
 
67
  inputs = processor(prompt, image, return_tensors="pt").to("cuda:0")
68
  output = vision_model.generate(**inputs, max_new_tokens=100)
69
+ return (processor.decode(output[0], skip_special_tokens=True))
70
 
71
 
72
  CSS = """