ssboost commited on
Commit
20bd654
ยท
verified ยท
1 Parent(s): 04b4200

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -276,7 +276,7 @@ def wrapper_modified(keyword, korean_only, apply_main_keyword_option, exclude_ze
276
  gr.update(choices=cat_choices),
277
  gr.update(choices=vol_choices),
278
  None,
279
- gr.update(choices=cat_choices, value=selected_cat),
280
  local_file,
281
  gr.update(visible=True),
282
  gr.update(visible=True),
@@ -360,19 +360,10 @@ def filter_and_sort_table(df, selected_cat, keyword_sort, total_volume_sort, usa
360
  def update_category_selection(selected_cat, session_id):
361
  """์นดํ…Œ๊ณ ๋ฆฌ ํ•„ํ„ฐ ์„ ํƒ ์‹œ ๋ถ„์„ํ•  ์นดํ…Œ๊ณ ๋ฆฌ๋„ ๊ฐ™์€ ๊ฐ’์œผ๋กœ ์—…๋ฐ์ดํŠธ"""
362
  update_session_activity(session_id)
 
363
 
364
- try:
365
- client = get_client()
366
- result = client.predict(
367
- selected_cat=selected_cat,
368
- api_name="/update_category_selection"
369
- )
370
-
371
- return gr.update(value=result)
372
-
373
- except Exception as e:
374
- logger.error(f"์นดํ…Œ๊ณ ๋ฆฌ ์„ ํƒ API ํ˜ธ์ถœ ์˜ค๋ฅ˜: {e}")
375
- return gr.update(value=selected_cat)
376
 
377
  def reset_interface(session_id):
378
  """์ธํ„ฐํŽ˜์ด์Šค ๋ฆฌ์…‹ ํ•จ์ˆ˜ - ์„ธ์…˜๋ณ„ ๋ฐ์ดํ„ฐ ์ดˆ๊ธฐํ™”"""
 
276
  gr.update(choices=cat_choices),
277
  gr.update(choices=vol_choices),
278
  None,
279
+ gr.update(choices=cat_choices, value=selected_cat), # ๋ถ„์„์šฉ ์นดํ…Œ๊ณ ๋ฆฌ๋„ ๊ฐ™์€ ์„ ํƒ์ง€๋กœ ์—…๋ฐ์ดํŠธ
280
  local_file,
281
  gr.update(visible=True),
282
  gr.update(visible=True),
 
360
  def update_category_selection(selected_cat, session_id):
361
  """์นดํ…Œ๊ณ ๋ฆฌ ํ•„ํ„ฐ ์„ ํƒ ์‹œ ๋ถ„์„ํ•  ์นดํ…Œ๊ณ ๋ฆฌ๋„ ๊ฐ™์€ ๊ฐ’์œผ๋กœ ์—…๋ฐ์ดํŠธ"""
362
  update_session_activity(session_id)
363
+ logger.info(f"์นดํ…Œ๊ณ ๋ฆฌ ์„ ํƒ ๋ณ€๊ฒฝ: {selected_cat}")
364
 
365
+ # ๋กœ์ปฌ์—์„œ ์ง์ ‘ ์ฒ˜๋ฆฌ (API ํ˜ธ์ถœ ์—†์ด)
366
+ return gr.update(value=selected_cat)
 
 
 
 
 
 
 
 
 
 
367
 
368
  def reset_interface(session_id):
369
  """์ธํ„ฐํŽ˜์ด์Šค ๋ฆฌ์…‹ ํ•จ์ˆ˜ - ์„ธ์…˜๋ณ„ ๋ฐ์ดํ„ฐ ์ดˆ๊ธฐํ™”"""