taesiri commited on
Commit
60b418c
1 Parent(s): 6fb1ca0
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -104,22 +104,23 @@ with gr.Blocks() as demo:
104
  with gr.Row():
105
  with gr.Column():
106
  reddit_id = gr.Textbox(
107
- lines=1, placeholder="Post url or id here", label="URL"
108
  )
109
  load_btn = gr.Button("Load")
110
  video_player = gr.Video()
111
 
112
  with gr.Column():
 
113
  latest_post_dataframe = gr.Dataframe()
114
  get_latest_pots_btn = gr.Button("Refresh Latest Posts")
115
 
116
- gr.Markdown("## Latest Posts")
117
-
118
  load_btn.click(load_video, inputs=[reddit_id], outputs=[video_player])
119
 
120
  get_latest_pots_btn.click(get_latest_pots, outputs=[latest_post_dataframe])
121
  demo.load(get_latest_pots, outputs=[latest_post_dataframe])
122
 
123
- latest_post_dataframe.select(fn=row_selected, outputs=[reddit_id])
 
 
124
 
125
  demo.launch()
 
104
  with gr.Row():
105
  with gr.Column():
106
  reddit_id = gr.Textbox(
107
+ lines=1, placeholder="Post url or id here", label="URL or Post ID"
108
  )
109
  load_btn = gr.Button("Load")
110
  video_player = gr.Video()
111
 
112
  with gr.Column():
113
+ gr.Markdown("## Latest Posts")
114
  latest_post_dataframe = gr.Dataframe()
115
  get_latest_pots_btn = gr.Button("Refresh Latest Posts")
116
 
 
 
117
  load_btn.click(load_video, inputs=[reddit_id], outputs=[video_player])
118
 
119
  get_latest_pots_btn.click(get_latest_pots, outputs=[latest_post_dataframe])
120
  demo.load(get_latest_pots, outputs=[latest_post_dataframe])
121
 
122
+ latest_post_dataframe.select(fn=row_selected, outputs=[reddit_id]).then(
123
+ load_video, inputs=[reddit_id], outputs=[video_player]
124
+ )
125
 
126
  demo.launch()