Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,22 +115,27 @@ def display_script(title, script):
|
|
| 115 |
|
| 116 |
def analyze(url, progress=gr.Progress()):
|
| 117 |
try:
|
| 118 |
-
|
| 119 |
title, description, script = get_youtube_script(url)
|
| 120 |
|
| 121 |
-
|
| 122 |
script_content = display_script(title, script)
|
| 123 |
-
|
| 124 |
-
# ์๋ฌธ ์คํฌ๋ฆฝํธ ๋จผ์ ์ถ๋ ฅํ๊ณ ์งํ
|
| 125 |
yield script_content, "์์ฝ ์ค๋น ์ค..."
|
| 126 |
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
-
|
| 134 |
yield script_content, summary_content
|
| 135 |
except Exception as e:
|
| 136 |
error_msg = f"์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}"
|
|
|
|
| 115 |
|
| 116 |
def analyze(url, progress=gr.Progress()):
|
| 117 |
try:
|
| 118 |
+
# ์คํฌ๋ฆฝํธ ์ถ์ถ (์งํ ์ํฉ ํ์ ์์ด)
|
| 119 |
title, description, script = get_youtube_script(url)
|
| 120 |
|
| 121 |
+
# ์๋ฌธ ์คํฌ๋ฆฝํธ ์ฒ๋ฆฌ ๋ฐ ์ถ๋ ฅ
|
| 122 |
script_content = display_script(title, script)
|
|
|
|
|
|
|
| 123 |
yield script_content, "์์ฝ ์ค๋น ์ค..."
|
| 124 |
|
| 125 |
+
# ์์ฝ ์์
์์ (์งํ ์ํฉ ํ์)
|
| 126 |
+
for i in progress.tqdm(range(3), desc="์์ฝ ์์ฑ ์ค..."):
|
| 127 |
+
if i == 0:
|
| 128 |
+
# ์์ฝ ์์ฑ
|
| 129 |
+
summary = summarize_text(title, description, script)
|
| 130 |
+
elif i == 1:
|
| 131 |
+
# ์์ฝ ๋ด์ฉ ์ ๋ฆฌ
|
| 132 |
+
summary_content = f"# {title}\n\n{summary}"
|
| 133 |
+
else:
|
| 134 |
+
# ์๋ฃ
|
| 135 |
+
pass
|
| 136 |
+
yield script_content, f"์์ฝ ์์ฑ ์ค... ({i+1}/3)"
|
| 137 |
|
| 138 |
+
# ์ต์ข
๊ฒฐ๊ณผ ์ถ๋ ฅ
|
| 139 |
yield script_content, summary_content
|
| 140 |
except Exception as e:
|
| 141 |
error_msg = f"์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}"
|