Shlok0311 commited on
Commit
5a80791
1 Parent(s): ba7b719

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -42,7 +42,12 @@ def predict_caption(image):
42
  if word == 'endseq':
43
  break
44
 
45
- return in_text
 
 
 
 
 
46
 
47
  def generate_caption(image):
48
  print(image)
 
42
  if word == 'endseq':
43
  break
44
 
45
+ # Split the generated sequence to exclude the first and last words
46
+ final_caption = in_text.split()[1:-1]
47
+ # Join the words to form the final caption
48
+ final_caption = ' '.join(final_caption)
49
+
50
+ return final_caption
51
 
52
  def generate_caption(image):
53
  print(image)