AIRider commited on
Commit
165681a
ยท
verified ยท
1 Parent(s): a23381e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -107,7 +107,7 @@ def summarize_text(title, description, text):
107
  ๋Œ€๋ณธ:
108
  {text}
109
  """
110
- return call_api(prompt, max_tokens=8000, temperature=0.35, top_p=0.95)
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 {"์˜ค๋ฅ˜": error_msg}
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,