Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,11 +23,17 @@ def generate_summary_and_video(url):
|
|
23 |
summary = generate_summary(url)
|
24 |
try:
|
25 |
video_id = url.split("v=")[1].split("&")[0]
|
26 |
-
iframe = f'<iframe width="
|
27 |
-
return f"{iframe}\n\n
|
28 |
except IndexError:
|
29 |
return f"**Summary:**\n{summary}\n\nInvalid YouTube URL for video display."
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
demo = gr.Interface(
|
32 |
fn=generate_summary_and_video,
|
33 |
inputs=gr.Textbox(lines=2, placeholder="Enter URL..."),
|
|
|
23 |
summary = generate_summary(url)
|
24 |
try:
|
25 |
video_id = url.split("v=")[1].split("&")[0]
|
26 |
+
iframe = f'<iframe width="300" height="200" src="https://www.youtube.com/embed/{video_id}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
|
27 |
+
return f"{iframe}\n\n Những ý chính trong video:\n{summary}"
|
28 |
except IndexError:
|
29 |
return f"**Summary:**\n{summary}\n\nInvalid YouTube URL for video display."
|
30 |
|
31 |
+
css = """
|
32 |
+
.output-html {
|
33 |
+
font-size: 20px;
|
34 |
+
}
|
35 |
+
"""
|
36 |
+
|
37 |
demo = gr.Interface(
|
38 |
fn=generate_summary_and_video,
|
39 |
inputs=gr.Textbox(lines=2, placeholder="Enter URL..."),
|