PierreBrunelle commited on
Commit
74b8f0b
·
verified ·
1 Parent(s): ad6db2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -70,13 +70,15 @@ def process_and_generate_post(video_file, social_media_type):
70
  }])
71
 
72
  # Retrieve Social media posts
73
- social_media_post = t.select(t.answer).show()['answer'][0]
74
 
75
  # Retrieve thumbnails
76
- thumbnails = frames_view.select(frames_view.frame).show(2)['frame']
 
 
77
 
78
  #Display content
79
- return social_media_post, thumbnails
80
 
81
  except Exception as e:
82
  return f"An error occurred: {str(e)}", None
@@ -120,6 +122,7 @@ def gradio_interface():
120
  show_fullscreen_button=True,
121
  height='400px'
122
  )
 
123
 
124
  gr.Examples(
125
  examples=[["example1.mp4"], ["example2.mp4"], ["example3.mp4"]],
@@ -129,7 +132,7 @@ def gradio_interface():
129
  generate_btn.click(
130
  fn=process_and_generate_post,
131
  inputs=[video_input, social_media_type],
132
- outputs=[output, thumbnail],
133
  )
134
 
135
  return demo
 
70
  }])
71
 
72
  # Retrieve Social media posts
73
+ social_media_post = t.select(t.answer).tail(1)['answer'][0]
74
 
75
  # Retrieve thumbnails
76
+ thumbnails = frames_view.select(frames_view.frame).tail(2)['frame']
77
+
78
+ df_output = t.show(1)
79
 
80
  #Display content
81
+ return social_media_post, thumbnails, df_output
82
 
83
  except Exception as e:
84
  return f"An error occurred: {str(e)}", None
 
122
  show_fullscreen_button=True,
123
  height='400px'
124
  )
125
+ df_output = gr.DataFrame(label="Latest Post Metrics")
126
 
127
  gr.Examples(
128
  examples=[["example1.mp4"], ["example2.mp4"], ["example3.mp4"]],
 
132
  generate_btn.click(
133
  fn=process_and_generate_post,
134
  inputs=[video_input, social_media_type],
135
+ outputs=[output, thumbnail, df_output],
136
  )
137
 
138
  return demo