ManishThota commited on
Commit
8b67eef
·
verified ·
1 Parent(s): 62c37f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -194,12 +194,8 @@ def gradio_predict(video,image, question):
194
 
195
 
196
  def convert_and_save(data):
197
- # Assuming 'data' is a dictionary that we want to save as CSV
198
- df = pd.DataFrame([data])
199
- # Convert the DataFrame to a CSV string
200
- csv_string = df.to_csv(index=False)
201
- # Return a tuple with the filename and the CSV string
202
- return ("annotations.csv", csv_string)
203
 
204
  css = """
205
  #container{
@@ -243,7 +239,7 @@ with gr.Blocks(css = css) as app:
243
  btn.click(gradio_predict, inputs=[video,image, question], outputs=answer)
244
 
245
  # Button to save the answer as CSV
246
- save_btn.click(fn=convert_and_save, inputs=answer, outputs=download_link)
247
 
248
 
249
  gr.Examples(
 
194
 
195
 
196
  def convert_and_save(data):
197
+
198
+ return data
 
 
 
 
199
 
200
  css = """
201
  #container{
 
239
  btn.click(gradio_predict, inputs=[video,image, question], outputs=answer)
240
 
241
  # Button to save the answer as CSV
242
+ save_btn.click(convert_and_save, inputs=answer, outputs=download_link)
243
 
244
 
245
  gr.Examples(