bhavyagiri commited on
Commit
60eda07
1 Parent(s): ca3c027

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -36,8 +36,6 @@ def get_answer(query,context):
36
  return res
37
 
38
 
39
- def update(name):
40
- return f"Welcome to Gradio, {name}!"
41
 
42
  with gr.Blocks() as demo:
43
  gr.Markdown("<h1><center>Youtube-QA</center></h1>")
@@ -48,11 +46,21 @@ with gr.Blocks() as demo:
48
  B -->C(Trascription)
49
  C -->|Query| D(QA-model)
50
  D -->E[Answer]
51
- """)
52
- with gr.Row():
53
- inp = gr.Textbox(placeholder="What is your name?")
54
- out = gr.Textbox()
55
- btn = gr.Button("Run")
56
- btn.click(fn=update, inputs=inp, outputs=out)
 
 
 
 
 
 
 
 
 
 
57
 
58
  demo.launch()
 
36
  return res
37
 
38
 
 
 
39
 
40
  with gr.Blocks() as demo:
41
  gr.Markdown("<h1><center>Youtube-QA</center></h1>")
 
46
  B -->C(Trascription)
47
  C -->|Query| D(QA-model)
48
  D -->E[Answer]
49
+ """)
50
+ with gr.Column():
51
+ with gr.Row():
52
+ in_yt = gr.Textbox(lines=1, placeholder="Enter Youtube URL", label="YouTube URL"))
53
+ transcribe_btn = gr.Button("Trascribe")
54
+ with gr.Column():
55
+ with gr.Row():
56
+ out_yt = ["html", "text"],
57
+ with gr.Column():
58
+ with gr.Row():
59
+ in_query = gr.Textbox(lines=1, placeholder="What's your Question", label="Query"))
60
+ ans_btn = gr.Button("Answer")
61
+ out_query = ["text"]
62
+
63
+ ans_btn.click(fn=get_answer, inputs=[in_query,out_yt["text"]], outputs=out_query)
64
+ transcribe_btn.click(fn=yt_transcribe, inputs=in_yt, outputs=out_yt)
65
 
66
  demo.launch()