Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
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:
|