Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -314,27 +314,26 @@ css = """
|
|
314 |
footer {visibility: hidden;}
|
315 |
|
316 |
#status_area {
|
317 |
-
position:
|
318 |
top: 0;
|
319 |
-
|
320 |
-
|
|
|
|
|
321 |
border-bottom: 2px solid #eee;
|
322 |
z-index: 1000;
|
323 |
margin-bottom: 20px;
|
324 |
}
|
325 |
|
326 |
#results_area {
|
327 |
-
margin-top:
|
328 |
-
padding
|
329 |
}
|
330 |
|
331 |
-
|
|
|
332 |
display: none !important;
|
333 |
}
|
334 |
-
|
335 |
-
.progress-container:first-child {
|
336 |
-
display: block !important;
|
337 |
-
}
|
338 |
"""
|
339 |
|
340 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as iface:
|
@@ -373,26 +372,24 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as
|
|
373 |
'index': i,
|
374 |
})
|
375 |
|
376 |
-
# ์ ์ธ๊ณ ํญ ๋ถ๋ถ์ ๋ค์๊ณผ ๊ฐ์ด ์์
|
377 |
with gr.Tab("์ ์ธ๊ณ"):
|
378 |
gr.Markdown("๊ฒ์์ด๋ฅผ ์
๋ ฅํ๋ฉด 67๊ฐ๊ตญ์ 24์๊ฐ ์ด๋ด ๋ด์ค๋ฅผ ์ต๋ 1000๊ฐ ์ถ๋ ฅํฉ๋๋ค.")
|
379 |
|
380 |
with gr.Column():
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
|
|
386 |
status_message_global = gr.Markdown("")
|
387 |
-
translated_query_display_global = gr.Markdown("")
|
388 |
progress_global = gr.Progress(track_tqdm=True)
|
389 |
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
with gr.Column(elem_id="results_area"):
|
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:
|
@@ -400,7 +397,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as
|
|
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,
|
@@ -410,6 +407,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as
|
|
410 |
'index': i,
|
411 |
})
|
412 |
|
|
|
413 |
def search_and_display(query, country, articles_state, progress=gr.Progress()):
|
414 |
status_msg = "๊ฒ์์ ์งํ์ค์
๋๋ค. ์ ์๋ง ๊ธฐ๋ค๋ฆฌ์ธ์..."
|
415 |
|
|
|
314 |
footer {visibility: hidden;}
|
315 |
|
316 |
#status_area {
|
317 |
+
position: fixed;
|
318 |
top: 0;
|
319 |
+
left: 0;
|
320 |
+
right: 0;
|
321 |
+
background: white;
|
322 |
+
padding: 20px;
|
323 |
border-bottom: 2px solid #eee;
|
324 |
z-index: 1000;
|
325 |
margin-bottom: 20px;
|
326 |
}
|
327 |
|
328 |
#results_area {
|
329 |
+
margin-top: 150px; /* status_area์ ๋์ด๋งํผ ์ฌ๋ฐฑ ์ถ๊ฐ */
|
330 |
+
padding: 20px;
|
331 |
}
|
332 |
|
333 |
+
/* ํ๋ก๊ทธ๋ ์ค๋ฐ ์ค๋ณต ์ถ๋ ฅ ๋ฐฉ์ง */
|
334 |
+
.progress-container:not(:first-child) {
|
335 |
display: none !important;
|
336 |
}
|
|
|
|
|
|
|
|
|
337 |
"""
|
338 |
|
339 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as iface:
|
|
|
372 |
'index': i,
|
373 |
})
|
374 |
|
|
|
375 |
with gr.Tab("์ ์ธ๊ณ"):
|
376 |
gr.Markdown("๊ฒ์์ด๋ฅผ ์
๋ ฅํ๋ฉด 67๊ฐ๊ตญ์ 24์๊ฐ ์ด๋ด ๋ด์ค๋ฅผ ์ต๋ 1000๊ฐ ์ถ๋ ฅํฉ๋๋ค.")
|
377 |
|
378 |
with gr.Column():
|
379 |
+
# ์๋จ ๊ณ ์ ์์ญ
|
380 |
+
with gr.Column(elem_id="status_area"):
|
381 |
+
with gr.Row():
|
382 |
+
query_global = gr.Textbox(label="๊ฒ์์ด")
|
383 |
+
search_button_global = gr.Button("์ ์ธ๊ณ ๊ฒ์", variant="primary")
|
384 |
+
|
385 |
status_message_global = gr.Markdown("")
|
386 |
+
translated_query_display_global = gr.Markdown("")
|
387 |
progress_global = gr.Progress(track_tqdm=True)
|
388 |
|
389 |
+
# ๊ฒฐ๊ณผ ์ถ๋ ฅ ์์ญ (์คํฌ๋กค ๊ฐ๋ฅ)
|
|
|
|
|
390 |
with gr.Column(elem_id="results_area"):
|
391 |
articles_state_global = gr.State([])
|
392 |
+
|
393 |
global_article_components = []
|
394 |
for i in range(1000):
|
395 |
with gr.Group(visible=False) as article_group:
|
|
|
397 |
image = gr.Image(width=200, height=150)
|
398 |
snippet = gr.Markdown()
|
399 |
info = gr.Markdown()
|
400 |
+
|
401 |
global_article_components.append({
|
402 |
'group': article_group,
|
403 |
'title': title,
|
|
|
407 |
'index': i,
|
408 |
})
|
409 |
|
410 |
+
|
411 |
def search_and_display(query, country, articles_state, progress=gr.Progress()):
|
412 |
status_msg = "๊ฒ์์ ์งํ์ค์
๋๋ค. ์ ์๋ง ๊ธฐ๋ค๋ฆฌ์ธ์..."
|
413 |
|