Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,7 +107,7 @@ def summarize_text(title, description, text):
|
|
| 107 |
๋๋ณธ:
|
| 108 |
{text}
|
| 109 |
"""
|
| 110 |
-
return call_api(prompt, max_tokens=
|
| 111 |
|
| 112 |
def analyze(url, progress=gr.Progress()):
|
| 113 |
try:
|
|
@@ -122,15 +122,11 @@ def analyze(url, progress=gr.Progress()):
|
|
| 122 |
summary = summarize_text(title, description, script)
|
| 123 |
|
| 124 |
progress(100, desc="์๋ฃ")
|
| 125 |
-
return
|
| 126 |
-
"์ ๋ชฉ": title,
|
| 127 |
-
"์๋ฌธ ์คํฌ๋ฆฝํธ": script_content,
|
| 128 |
-
"์์ฝ": summary
|
| 129 |
-
}
|
| 130 |
except Exception as e:
|
| 131 |
error_msg = f"์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}"
|
| 132 |
logging.exception(error_msg)
|
| 133 |
-
return
|
| 134 |
|
| 135 |
# Gradio ์ธํฐํ์ด์ค
|
| 136 |
with gr.Blocks() as demo:
|
|
@@ -138,13 +134,13 @@ with gr.Blocks() as demo:
|
|
| 138 |
youtube_url_input = gr.Textbox(label="YouTube URL ์
๋ ฅ")
|
| 139 |
analyze_button = gr.Button("๋ถ์ํ๊ธฐ")
|
| 140 |
|
|
|
|
|
|
|
| 141 |
with gr.Tabs():
|
| 142 |
with gr.TabItem("์๋ฌธ ์คํฌ๋ฆฝํธ"):
|
| 143 |
script_output = gr.Markdown()
|
| 144 |
with gr.TabItem("์์ฝ"):
|
| 145 |
summary_output = gr.Markdown()
|
| 146 |
-
|
| 147 |
-
title_output = gr.Textbox(label="์์ ์ ๋ชฉ")
|
| 148 |
|
| 149 |
analyze_button.click(
|
| 150 |
analyze,
|
|
|
|
| 107 |
๋๋ณธ:
|
| 108 |
{text}
|
| 109 |
"""
|
| 110 |
+
return call_api(prompt, max_tokens=2000, temperature=0.3, top_p=0.9)
|
| 111 |
|
| 112 |
def analyze(url, progress=gr.Progress()):
|
| 113 |
try:
|
|
|
|
| 122 |
summary = summarize_text(title, description, script)
|
| 123 |
|
| 124 |
progress(100, desc="์๋ฃ")
|
| 125 |
+
return title, script_content, summary
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
except Exception as e:
|
| 127 |
error_msg = f"์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}"
|
| 128 |
logging.exception(error_msg)
|
| 129 |
+
return "์ค๋ฅ ๋ฐ์", error_msg, error_msg
|
| 130 |
|
| 131 |
# Gradio ์ธํฐํ์ด์ค
|
| 132 |
with gr.Blocks() as demo:
|
|
|
|
| 134 |
youtube_url_input = gr.Textbox(label="YouTube URL ์
๋ ฅ")
|
| 135 |
analyze_button = gr.Button("๋ถ์ํ๊ธฐ")
|
| 136 |
|
| 137 |
+
title_output = gr.Textbox(label="์์ ์ ๋ชฉ")
|
| 138 |
+
|
| 139 |
with gr.Tabs():
|
| 140 |
with gr.TabItem("์๋ฌธ ์คํฌ๋ฆฝํธ"):
|
| 141 |
script_output = gr.Markdown()
|
| 142 |
with gr.TabItem("์์ฝ"):
|
| 143 |
summary_output = gr.Markdown()
|
|
|
|
|
|
|
| 144 |
|
| 145 |
analyze_button.click(
|
| 146 |
analyze,
|