Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -190,10 +190,17 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI 서비스") as
|
|
190 |
for idx, comp in enumerate(article_components):
|
191 |
if idx < len(articles):
|
192 |
article = articles[idx]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
outputs.extend([
|
194 |
gr.update(visible=True), # group
|
195 |
gr.update(value=f"### [{article['title']}]({article['link']})"), # title
|
196 |
-
|
197 |
gr.update(value=f"**요약:** {article['snippet']}"), # snippet
|
198 |
gr.update(value=f"**출처:** {article['channel']} | **시간:** {article['time']}"), # info
|
199 |
gr.update(visible=False), # summary_output
|
@@ -247,4 +254,4 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css, title="NewsAI 서비스") as
|
|
247 |
outputs=comp['summary_output']
|
248 |
)
|
249 |
|
250 |
-
iface.launch(auth=("gini", "pick"))
|
|
|
190 |
for idx, comp in enumerate(article_components):
|
191 |
if idx < len(articles):
|
192 |
article = articles[idx]
|
193 |
+
# 이미지 처리 수정
|
194 |
+
image_url = article['image_url']
|
195 |
+
if image_url and not image_url.startswith('data:image'):
|
196 |
+
image_update = gr.update(value=image_url, visible=True)
|
197 |
+
else:
|
198 |
+
image_update = gr.update(value=None, visible=False)
|
199 |
+
|
200 |
outputs.extend([
|
201 |
gr.update(visible=True), # group
|
202 |
gr.update(value=f"### [{article['title']}]({article['link']})"), # title
|
203 |
+
image_update, # image
|
204 |
gr.update(value=f"**요약:** {article['snippet']}"), # snippet
|
205 |
gr.update(value=f"**출처:** {article['channel']} | **시간:** {article['time']}"), # info
|
206 |
gr.update(visible=False), # summary_output
|
|
|
254 |
outputs=comp['summary_output']
|
255 |
)
|
256 |
|
257 |
+
iface.launch(auth=("gini", "pick"))
|