Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -186,7 +186,12 @@ test_examples = [[None, "Images/cat_dog.jpeg", promt_cat_dog],
|
|
186 |
|
187 |
def gradio_predict(video,image, question):
|
188 |
answer = predict_answer(video,image, question)
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
css = """
|
192 |
#container{
|
@@ -221,6 +226,7 @@ with gr.Blocks(css = css) as app:
|
|
221 |
btn = gr.Button("Annotate")
|
222 |
with gr.Column():
|
223 |
answer = gr.TextArea(label="Answer")
|
|
|
224 |
|
225 |
|
226 |
btn.click(gradio_predict, inputs=[video,image, question], outputs=answer)
|
|
|
186 |
|
187 |
def gradio_predict(video,image, question):
|
188 |
answer = predict_answer(video,image, question)
|
189 |
+
# Convert the DataFrame to CSV
|
190 |
+
output_buffer = BytesIO()
|
191 |
+
df.to_csv(answer, index=False)
|
192 |
+
output_buffer.seek(0)
|
193 |
+
|
194 |
+
return answer, output_buffer
|
195 |
|
196 |
css = """
|
197 |
#container{
|
|
|
226 |
btn = gr.Button("Annotate")
|
227 |
with gr.Column():
|
228 |
answer = gr.TextArea(label="Answer")
|
229 |
+
output_buffer = gr.File(label="Download CSV", file_count="single")
|
230 |
|
231 |
|
232 |
btn.click(gradio_predict, inputs=[video,image, question], outputs=answer)
|