springwater commited on
Commit
2fa67b7
โ€ข
1 Parent(s): 2abbd75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
+