Update app.py
Browse files
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 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
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 |
# ๊ฒ์ ์ํ ๋ฉ์์ง ์
๋ฐ์ดํธ
|