Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -130,24 +130,24 @@ def display_summary(title, summary):
|
|
130 |
return f"""<div style="background-color: #e6f3ff; padding: 20px; border-radius: 10px; margin-top: 20px;">
|
131 |
<h3>์์ฝ</h3>
|
132 |
<h2>{title}</h2>
|
133 |
-
|
134 |
</div>"""
|
135 |
|
136 |
def analyze(url):
|
137 |
# ์คํฌ๋ฆฝํธ ์ถ์ถ
|
138 |
-
yield
|
139 |
title, description, script = get_youtube_script(url)
|
140 |
script_content = display_script(title, script)
|
141 |
|
142 |
# ์๋ฌธ ์คํฌ๋ฆฝํธ ํ์ ๋ฐ ์์ฝ ์์
|
143 |
-
yield gr.update(
|
144 |
|
145 |
# ์์ฝ ์์ฑ
|
146 |
summary = summarize_text(title, description, script)
|
147 |
-
summary_content =
|
148 |
|
149 |
# ์ต์ข
๊ฒฐ๊ณผ ํ์
|
150 |
-
yield gr.update(
|
151 |
|
152 |
# Gradio ์ธํฐํ์ด์ค
|
153 |
with gr.Blocks() as demo:
|
@@ -160,7 +160,7 @@ with gr.Blocks() as demo:
|
|
160 |
analyze_button.click(
|
161 |
analyze,
|
162 |
inputs=[youtube_url_input],
|
163 |
-
outputs=[script_output, summary_output]
|
164 |
)
|
165 |
|
166 |
if __name__ == "__main__":
|
|
|
130 |
return f"""<div style="background-color: #e6f3ff; padding: 20px; border-radius: 10px; margin-top: 20px;">
|
131 |
<h3>์์ฝ</h3>
|
132 |
<h2>{title}</h2>
|
133 |
+
{summary}
|
134 |
</div>"""
|
135 |
|
136 |
def analyze(url):
|
137 |
# ์คํฌ๋ฆฝํธ ์ถ์ถ
|
138 |
+
yield "์คํฌ๋ฆฝํธ ์ถ์ถ ์ค...", gr.update(visible=True), gr.update(visible=False)
|
139 |
title, description, script = get_youtube_script(url)
|
140 |
script_content = display_script(title, script)
|
141 |
|
142 |
# ์๋ฌธ ์คํฌ๋ฆฝํธ ํ์ ๋ฐ ์์ฝ ์์
|
143 |
+
yield script_content, gr.update(visible=True), "์์ฝ ์์ฑ ์ค..."
|
144 |
|
145 |
# ์์ฝ ์์ฑ
|
146 |
summary = summarize_text(title, description, script)
|
147 |
+
summary_content = display_summary(title, summary)
|
148 |
|
149 |
# ์ต์ข
๊ฒฐ๊ณผ ํ์
|
150 |
+
yield script_content, gr.update(visible=True), summary_content
|
151 |
|
152 |
# Gradio ์ธํฐํ์ด์ค
|
153 |
with gr.Blocks() as demo:
|
|
|
160 |
analyze_button.click(
|
161 |
analyze,
|
162 |
inputs=[youtube_url_input],
|
163 |
+
outputs=[script_output, script_output, summary_output]
|
164 |
)
|
165 |
|
166 |
if __name__ == "__main__":
|