soojeongcrystal commited on
Commit
777fd1a
ยท
verified ยท
1 Parent(s): 1fe42c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -233,6 +233,7 @@ with gr.Blocks(css=".gradio-button {background-color: #007bff; color: white;} .g
233
  analyze_button = gr.Button("๋ถ„์„ ์‹œ์ž‘", elem_classes="gradio-button")
234
  output_table = gr.DataFrame(label="๋ถ„์„ ๊ฒฐ๊ณผ (ํ…Œ์ด๋ธ”)")
235
  csv_download = gr.File(label="์ถ”์ฒœ ๊ฒฐ๊ณผ ๋‹ค์šด๋กœ๋“œ", visible=False)
 
236
 
237
  with gr.Column(scale=2, min_width=500):
238
  gr.Markdown("<h3 style='color: #34495e;'>2. ๋ถ„์„ ๊ฒฐ๊ณผ ๋ฐ ์‹œ๊ฐํ™”</h3>")
@@ -244,15 +245,18 @@ with gr.Blocks(css=".gradio-button {background-color: #007bff; color: white;} .g
244
  clear = gr.Button("๋Œ€ํ™” ๋‚ด์—ญ ์ง€์šฐ๊ธฐ")
245
 
246
  # ๋ถ„์„ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ํ…Œ์ด๋ธ”, ์ฐจํŠธ, ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์—…๋ฐ์ดํŠธ
247
- analyze_button.click(hybrid_rag,
248
- inputs=[employee_file, program_file, youtube_file, title_col, description_col, url_col, upload_date_col],
249
- outputs=[output_table, chart_output, csv_download])
 
 
250
 
251
  # CSV ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ
252
- csv_download.click(download_csv, inputs=[], outputs=[csv_download])
253
 
254
  # ์ฑ„ํŒ… ๊ธฐ๋Šฅ
255
  msg.submit(chat_response, [msg, chatbot], [chatbot])
256
  clear.click(lambda: None, None, chatbot, queue=False)
257
 
 
258
  demo.launch()
 
233
  analyze_button = gr.Button("๋ถ„์„ ์‹œ์ž‘", elem_classes="gradio-button")
234
  output_table = gr.DataFrame(label="๋ถ„์„ ๊ฒฐ๊ณผ (ํ…Œ์ด๋ธ”)")
235
  csv_download = gr.File(label="์ถ”์ฒœ ๊ฒฐ๊ณผ ๋‹ค์šด๋กœ๋“œ", visible=False)
236
+ download_button = gr.Button("CSV ๋‹ค์šด๋กœ๋“œ", visible=False)
237
 
238
  with gr.Column(scale=2, min_width=500):
239
  gr.Markdown("<h3 style='color: #34495e;'>2. ๋ถ„์„ ๊ฒฐ๊ณผ ๋ฐ ์‹œ๊ฐํ™”</h3>")
 
245
  clear = gr.Button("๋Œ€ํ™” ๋‚ด์—ญ ์ง€์šฐ๊ธฐ")
246
 
247
  # ๋ถ„์„ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ํ…Œ์ด๋ธ”, ์ฐจํŠธ, ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์—…๋ฐ์ดํŠธ
248
+ analyze_result = analyze_button.click(
249
+ hybrid_rag,
250
+ inputs=[employee_file, program_file, youtube_file, title_col, description_col, url_col, upload_date_col],
251
+ outputs=[output_table, chart_output, csv_download, download_button]
252
+ )
253
 
254
  # CSV ๋‹ค์šด๋กœ๋“œ ๋ฒ„ํŠผ
255
+ download_button.click(download_csv, inputs=[], outputs=[csv_download])
256
 
257
  # ์ฑ„ํŒ… ๊ธฐ๋Šฅ
258
  msg.submit(chat_response, [msg, chatbot], [chatbot])
259
  clear.click(lambda: None, None, chatbot, queue=False)
260
 
261
+ # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
262
  demo.launch()