openfree commited on
Commit
6f3517b
ยท
verified ยท
1 Parent(s): b79e8b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -26
app.py CHANGED
@@ -312,6 +312,24 @@ def serphouse_search(query, country):
312
 
313
  css = """
314
  footer {visibility: hidden;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  """
316
 
317
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์„œ๋น„์Šค") as iface:
@@ -354,35 +372,45 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์„œ๋น„์Šค") as
354
  'index': i,
355
  })
356
 
357
- # ์ „์„ธ๊ณ„ ํƒญ
 
358
  with gr.Tab("์ „์„ธ๊ณ„"):
359
  gr.Markdown("๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด 67๊ฐœ๊ตญ์˜ 24์‹œ๊ฐ„ ์ด๋‚ด ๋‰ด์Šค๋ฅผ ์ตœ๋Œ€ 1000๊ฐœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.")
360
-
361
  with gr.Column():
362
- query_global = gr.Textbox(label="๊ฒ€์ƒ‰์–ด")
363
- status_message_global = gr.Markdown("", visible=True)
364
- translated_query_display_global = gr.Markdown(visible=False)
365
- search_button_global = gr.Button("์ „์„ธ๊ณ„ ๊ฒ€์ƒ‰", variant="primary")
366
-
367
- progress_global = gr.Progress()
368
- articles_state_global = gr.State([])
369
-
370
- global_article_components = []
371
- for i in range(1000):
372
- with gr.Group(visible=False) as article_group:
373
- title = gr.Markdown()
374
- image = gr.Image(width=200, height=150)
375
- snippet = gr.Markdown()
376
- info = gr.Markdown()
377
-
378
- global_article_components.append({
379
- 'group': article_group,
380
- 'title': title,
381
- 'image': image,
382
- 'snippet': snippet,
383
- 'info': info,
384
- 'index': i,
385
- })
 
 
 
 
 
 
 
 
 
386
 
387
  def search_and_display(query, country, articles_state, progress=gr.Progress()):
388
  # ๊ฒ€์ƒ‰ ์ƒํƒœ ๋ฉ”์‹œ์ง€ ์—…๋ฐ์ดํŠธ
 
312
 
313
  css = """
314
  footer {visibility: hidden;}
315
+
316
+ /* ์ „์—ญ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ */
317
+ #global_results_container {
318
+ margin-top: 20px;
319
+ border-top: 1px solid #eee;
320
+ padding-top: 20px;
321
+ }
322
+
323
+ /* ์ง„ํ–‰ ์ƒํƒœ ๋ฐ•์Šค ์Šคํƒ€์ผ */
324
+ .progress-box {
325
+ position: sticky;
326
+ top: 0;
327
+ background: white;
328
+ padding: 10px;
329
+ border-bottom: 1px solid #eee;
330
+ z-index: 100;
331
+ margin-bottom: 20px;
332
+ }
333
  """
334
 
335
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์„œ๋น„์Šค") as iface:
 
372
  'index': i,
373
  })
374
 
375
+
376
+ # ์ „์„ธ๊ณ„ ํƒญ
377
  with gr.Tab("์ „์„ธ๊ณ„"):
378
  gr.Markdown("๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด 67๊ฐœ๊ตญ์˜ 24์‹œ๊ฐ„ ์ด๋‚ด ๋‰ด์Šค๋ฅผ ์ตœ๋Œ€ 1000๊ฐœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.")
379
+
380
  with gr.Column():
381
+ # ์ƒ๋‹จ ๊ฒ€์ƒ‰ ์˜์—ญ
382
+ with gr.Row():
383
+ query_global = gr.Textbox(label="๊ฒ€์ƒ‰์–ด")
384
+ search_button_global = gr.Button("์ „์„ธ๊ณ„ ๊ฒ€์ƒ‰", variant="primary")
385
+
386
+ # ์ง„ํ–‰ ์ƒํƒœ ํ‘œ์‹œ ์˜์—ญ (๊ณ ์ • ์œ„์น˜)
387
+ with gr.Box(): # Box๋กœ ๊ตฌ๋ถ„์„  ์ถ”๊ฐ€
388
+ status_message_global = gr.Markdown("", visible=True)
389
+ translated_query_display_global = gr.Markdown(visible=False)
390
+ progress_global = gr.Progress()
391
+
392
+ # ๊ฒฐ๊ณผ ์ถœ๋ ฅ ์˜์—ญ (์Šคํฌ๋กค ๊ฐ€๋Šฅ)
393
+ with gr.Column(elem_id="global_results_container"):
394
+ articles_state_global = gr.State([])
395
+
396
+ global_article_components = []
397
+ for i in range(1000):
398
+ with gr.Group(visible=False) as article_group:
399
+ title = gr.Markdown()
400
+ image = gr.Image(width=200, height=150)
401
+ snippet = gr.Markdown()
402
+ info = gr.Markdown()
403
+
404
+ global_article_components.append({
405
+ 'group': article_group,
406
+ 'title': title,
407
+ 'image': image,
408
+ 'snippet': snippet,
409
+ 'info': info,
410
+ 'index': i,
411
+ })
412
+
413
+
414
 
415
  def search_and_display(query, country, articles_state, progress=gr.Progress()):
416
  # ๊ฒ€์ƒ‰ ์ƒํƒœ ๋ฉ”์‹œ์ง€ ์—…๋ฐ์ดํŠธ