jeffh commited on
Commit
c9a38e2
1 Parent(s): 01e86a3

populate thumbnail and title before

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -36,19 +36,23 @@ with block:
36
  )
37
  with gr.Group():
38
  with gr.Box():
39
- sz = gr.Dropdown(
40
- label="Model Size",
41
- choices=['base', 'small', 'medium', 'large'],
42
- value='base'
43
- )
44
- sz.change(change_model, inputs=[sz], outputs=[])
45
  link = gr.Textbox(label="YouTube Link")
 
 
 
 
46
  text = gr.Textbox(
47
  label="Transcription",
48
  placeholder="Transcription Output",
49
  lines=5)
50
  with gr.Row().style(mobile_collapse=False, equal_height=True):
51
  btn = gr.Button("Transcribe")
52
- btn.click(inference, inputs=[link], outputs=[text])
 
 
 
 
53
 
54
- block.launch()
 
36
  )
37
  with gr.Group():
38
  with gr.Box():
39
+ sz = gr.Dropdown(label="Model Size", choices=['base','small', 'medium', 'large'], value='base')
40
+
 
 
 
 
41
  link = gr.Textbox(label="YouTube Link")
42
+
43
+ with gr.Row().style(mobile_collapse=False, equal_height=True):
44
+ title = gr.Label(label="Video Title", placeholder="Title")
45
+ img = gr.Image(label="Thumbnail")
46
  text = gr.Textbox(
47
  label="Transcription",
48
  placeholder="Transcription Output",
49
  lines=5)
50
  with gr.Row().style(mobile_collapse=False, equal_height=True):
51
  btn = gr.Button("Transcribe")
52
+
53
+ # Events
54
+ btn.click(inference, inputs=[link], outputs=[text])
55
+ link.change(populate_metadata, inputs=[link], outputs=[img, title])
56
+ sz.change(change_model, inputs=[sz], outputs=[])
57
 
58
+ block.launch(debug=True)