Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ MAJOR_COUNTRIES = [
|
|
22 |
"Indonesia", "Philippines", "Vietnam", "Pakistan", "Bangladesh"
|
23 |
]
|
24 |
|
25 |
-
def search_serphouse(query, country, page=1, num_result=
|
26 |
url = "https://api.serphouse.com/serp/live"
|
27 |
|
28 |
now = datetime.utcnow()
|
@@ -113,7 +113,7 @@ def format_results_from_raw(results):
|
|
113 |
|
114 |
def serphouse_search(query, country):
|
115 |
page = 1
|
116 |
-
num_result =
|
117 |
results = search_serphouse(query, country, page, num_result)
|
118 |
error_message, articles = format_results_from_raw(results)
|
119 |
return error_message, articles
|
@@ -137,7 +137,7 @@ footer {
|
|
137 |
|
138 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
139 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as iface:
|
140 |
-
gr.Markdown("๊ฒ์์ด๋ฅผ ์
๋ ฅํ๊ณ ์ํ๋ ๊ตญ๊ฐ๋ฅผ ์ ํํ๋ฉด, ๊ฒ์์ด์ ์ผ์นํ๋ 24์๊ฐ ์ด๋ด ๋ด์ค๋ฅผ ์ต๋
|
141 |
|
142 |
with gr.Column():
|
143 |
with gr.Row():
|
@@ -151,9 +151,9 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as
|
|
151 |
# ๊ธฐ์ฌ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ์ํ ๋ณ์
|
152 |
articles_state = gr.State([]) # ์ด๊ธฐ๊ฐ์ ๋น ๋ฆฌ์คํธ๋ก ์ค์
|
153 |
|
154 |
-
# ์ต๋
|
155 |
article_components = []
|
156 |
-
for i in range(
|
157 |
with gr.Group(visible=False) as article_group:
|
158 |
title = gr.Markdown()
|
159 |
image = gr.Image(width=200, height=150)
|
|
|
22 |
"Indonesia", "Philippines", "Vietnam", "Pakistan", "Bangladesh"
|
23 |
]
|
24 |
|
25 |
+
def search_serphouse(query, country, page=1, num_result=100): # num_result๋ฅผ 100์ผ๋ก ๋ณ๊ฒฝ
|
26 |
url = "https://api.serphouse.com/serp/live"
|
27 |
|
28 |
now = datetime.utcnow()
|
|
|
113 |
|
114 |
def serphouse_search(query, country):
|
115 |
page = 1
|
116 |
+
num_result = 100 # num_result๋ฅผ 100์ผ๋ก ์ค์
|
117 |
results = search_serphouse(query, country, page, num_result)
|
118 |
error_message, articles = format_results_from_raw(results)
|
119 |
return error_message, articles
|
|
|
137 |
|
138 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
139 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI ์๋น์ค") as iface:
|
140 |
+
gr.Markdown("๊ฒ์์ด๋ฅผ ์
๋ ฅํ๊ณ ์ํ๋ ๊ตญ๊ฐ๋ฅผ ์ ํํ๋ฉด, ๊ฒ์์ด์ ์ผ์นํ๋ 24์๊ฐ ์ด๋ด ๋ด์ค๋ฅผ ์ต๋ 100๊ฐ ์ถ๋ ฅํฉ๋๋ค.")
|
141 |
|
142 |
with gr.Column():
|
143 |
with gr.Row():
|
|
|
151 |
# ๊ธฐ์ฌ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ์ํ ๋ณ์
|
152 |
articles_state = gr.State([]) # ์ด๊ธฐ๊ฐ์ ๋น ๋ฆฌ์คํธ๋ก ์ค์
|
153 |
|
154 |
+
# ์ต๋ 100๊ฐ์ ๊ธฐ์ฌ์ ๋ํ ์ปดํฌ๋ํธ๋ฅผ ๋ฏธ๋ฆฌ ์์ฑํฉ๋๋ค.
|
155 |
article_components = []
|
156 |
+
for i in range(100): # 100๊ฐ์ ์ปดํฌ๋ํธ ์์ฑ
|
157 |
with gr.Group(visible=False) as article_group:
|
158 |
title = gr.Markdown()
|
159 |
image = gr.Image(width=200, height=150)
|