Shivdutta commited on
Commit
67c8bff
Β·
verified Β·
1 Parent(s): fa8b743

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -114,7 +114,11 @@ def model_generate_ans(img=None,img_audio=None,val_q=None):
114
 
115
  predicted_captions_decoded = tokenizer.batch_decode(predicted_caption,ignore_index = 50256)[0]
116
 
117
- return predicted_captions_decoded
 
 
 
 
118
 
119
 
120
  with gr.Blocks() as demo:
 
114
 
115
  predicted_captions_decoded = tokenizer.batch_decode(predicted_caption,ignore_index = 50256)[0]
116
 
117
+ # Split the string at the first occurrence of <|endoftext|>
118
+ result = predicted_captions_decoded.split('<|endoftext|>')[0]
119
+ return result.strip() # Strip any trailing spaces or newlines
120
+
121
+ #return predicted_captions_decoded
122
 
123
 
124
  with gr.Blocks() as demo: