springwater
commited on
Commit
โข
2fa67b7
1
Parent(s):
2abbd75
Update app.py
Browse files
app.py
CHANGED
@@ -69,6 +69,7 @@ def summarize_youtube_videos(keyword):
|
|
69 |
# # Launch Gradio interface
|
70 |
# iface.launch()
|
71 |
|
|
|
72 |
iface = gr.Interface(
|
73 |
inputs=[
|
74 |
gr.Textbox(label="keyword", placeholder='ํค์๋๋ฅผ ์
๋ ฅํ์ธ์. (์.๋นํธ์ฝ์ธ)'),
|
@@ -76,14 +77,14 @@ iface = gr.Interface(
|
|
76 |
],
|
77 |
outputs=gr.JSON(label='์ ํ๋ธ 5๊ฐ ์์ฝ ๊ฒฐ๊ณผ'),
|
78 |
title="Summarize YouTube Videos",
|
79 |
-
description="Enter a keyword to summarize related YouTube videos."
|
|
|
80 |
)
|
81 |
|
82 |
def summarize_button_click(keyword, OPENAI_API_KEY):
|
83 |
summary = summarize_youtube_videos(keyword, OPENAI_API_KEY)
|
84 |
return summary
|
85 |
|
86 |
-
iface.button("submit", summarize_button_click)
|
87 |
-
|
88 |
# Launch Gradio interface
|
89 |
iface.launch()
|
|
|
|
69 |
# # Launch Gradio interface
|
70 |
# iface.launch()
|
71 |
|
72 |
+
# Define Gradio interface
|
73 |
iface = gr.Interface(
|
74 |
inputs=[
|
75 |
gr.Textbox(label="keyword", placeholder='ํค์๋๋ฅผ ์
๋ ฅํ์ธ์. (์.๋นํธ์ฝ์ธ)'),
|
|
|
77 |
],
|
78 |
outputs=gr.JSON(label='์ ํ๋ธ 5๊ฐ ์์ฝ ๊ฒฐ๊ณผ'),
|
79 |
title="Summarize YouTube Videos",
|
80 |
+
description="Enter a keyword to summarize related YouTube videos.",
|
81 |
+
fn=summarize_button_click # ํด๋ฆญ ์ด๋ฒคํธ๋ฅผ ์ฒ๋ฆฌํ๋ ํจ์๋ฅผ ์ฌ๊ธฐ์ ์ ์ํฉ๋๋ค.
|
82 |
)
|
83 |
|
84 |
def summarize_button_click(keyword, OPENAI_API_KEY):
|
85 |
summary = summarize_youtube_videos(keyword, OPENAI_API_KEY)
|
86 |
return summary
|
87 |
|
|
|
|
|
88 |
# Launch Gradio interface
|
89 |
iface.launch()
|
90 |
+
|