Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
title = "YouTube Summorize (en,ua,ru)"
|
| 3 |
+
css="""
|
| 4 |
+
footer {visibility: hidden}
|
| 5 |
+
.gradio-container {padding-top: 100px}
|
| 6 |
+
"""
|
| 7 |
+
with gr.Blocks(css=css, title=title) as demo:
|
| 8 |
+
gr.HTML("<h3>A simple way to summarize YouTube video</h3>")
|
| 9 |
+
with gr.Row():
|
| 10 |
+
with gr.Column():
|
| 11 |
+
input_d = gr.Textbox(label="YouTube video URL", placeholder="https://www.youtube.com/watch?v=XXXXXXXX", value="")
|
| 12 |
+
greet_btn = gr.Button("Summarise")
|
| 13 |
+
dt_2 = gr.outputs.HTML()
|
| 14 |
+
dt_1 = gr.outputs.HTML()
|
| 15 |
+
dt =[dt_1, dt_2]
|
| 16 |
+
greet_btn.click(generate_video_html, inputs=input_d, outputs=dt_2)
|
| 17 |
+
greet_btn.click(generate, inputs=input_d, outputs=dt_1)
|
| 18 |
+
demo.load(generate_video_html, inputs=input_d, outputs=dt_2)
|
| 19 |
+
demo.load(generate, inputs=input_d, outputs=dt_1)
|
| 20 |
+
|
| 21 |
+
demo.queue()
|
| 22 |
+
demo.launch(debug=True, share=False)
|