Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -146,20 +146,26 @@ def analyze(url):
|
|
| 146 |
summary = summarize_text(title, description, script)
|
| 147 |
|
| 148 |
# ๋งํฌ๋ค์ด ๊ธฐํธ ์ ๊ฑฐ ๋ฐ HTML ํ๊ทธ๋ก ์ง์ ๋ณํ
|
| 149 |
-
|
| 150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
|
| 152 |
summary_content = f"""<div style="background-color: #e6f3ff; padding: 20px; border-radius: 10px; margin-top: 20px;">
|
| 153 |
<h3>์์ฝ</h3>
|
| 154 |
<h2>{title}</h2>
|
| 155 |
-
{
|
| 156 |
</div>"""
|
| 157 |
|
| 158 |
# ์ต์ข
๊ฒฐ๊ณผ ํ์
|
| 159 |
yield script_content, summary_content
|
| 160 |
|
| 161 |
-
# Gradio ์ธํฐํ์ด์ค๋ ์ด์ ๊ณผ ๋์ผ
|
| 162 |
-
|
| 163 |
# Gradio ์ธํฐํ์ด์ค
|
| 164 |
with gr.Blocks() as demo:
|
| 165 |
gr.Markdown("## YouTube ์คํฌ๋ฆฝํธ ์ถ์ถ ๋ฐ ์์ฝ ๋๊ตฌ")
|
|
|
|
| 146 |
summary = summarize_text(title, description, script)
|
| 147 |
|
| 148 |
# ๋งํฌ๋ค์ด ๊ธฐํธ ์ ๊ฑฐ ๋ฐ HTML ํ๊ทธ๋ก ์ง์ ๋ณํ
|
| 149 |
+
lines = summary.split('\n')
|
| 150 |
+
formatted_lines = []
|
| 151 |
+
for line in lines:
|
| 152 |
+
if line.startswith('###'):
|
| 153 |
+
line = f"<h3>{line[4:]}</h3>"
|
| 154 |
+
else:
|
| 155 |
+
line = f"<p>{line}</p>"
|
| 156 |
+
formatted_lines.append(line)
|
| 157 |
+
|
| 158 |
+
formatted_summary = '\n'.join(formatted_lines)
|
| 159 |
|
| 160 |
summary_content = f"""<div style="background-color: #e6f3ff; padding: 20px; border-radius: 10px; margin-top: 20px;">
|
| 161 |
<h3>์์ฝ</h3>
|
| 162 |
<h2>{title}</h2>
|
| 163 |
+
{formatted_summary}
|
| 164 |
</div>"""
|
| 165 |
|
| 166 |
# ์ต์ข
๊ฒฐ๊ณผ ํ์
|
| 167 |
yield script_content, summary_content
|
| 168 |
|
|
|
|
|
|
|
| 169 |
# Gradio ์ธํฐํ์ด์ค
|
| 170 |
with gr.Blocks() as demo:
|
| 171 |
gr.Markdown("## YouTube ์คํฌ๋ฆฝํธ ์ถ์ถ ๋ฐ ์์ฝ ๋๊ตฌ")
|