Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ def summarize_news(query, num_results=3):
|
|
| 20 |
logging.debug("Searching for news articles...")
|
| 21 |
search_results = search(query, num_results=num_results)
|
| 22 |
articles = []
|
| 23 |
-
|
| 24 |
logging.debug(f"Search results: {search_results}")
|
| 25 |
|
| 26 |
for url in search_results:
|
|
@@ -79,11 +79,15 @@ def format_output(articles):
|
|
| 79 |
return formatted_text
|
| 80 |
|
| 81 |
iface = gr.Interface(
|
| 82 |
-
fn=
|
| 83 |
-
inputs=[
|
| 84 |
outputs="text",
|
| 85 |
title="News Summarizer",
|
| 86 |
-
description="Enter a query to get summarized versions of the top news articles."
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
)
|
| 88 |
|
| 89 |
if __name__ == "__main__":
|
|
|
|
| 20 |
logging.debug("Searching for news articles...")
|
| 21 |
search_results = search(query, num_results=num_results)
|
| 22 |
articles = []
|
| 23 |
+
|
| 24 |
logging.debug(f"Search results: {search_results}")
|
| 25 |
|
| 26 |
for url in search_results:
|
|
|
|
| 79 |
return formatted_text
|
| 80 |
|
| 81 |
iface = gr.Interface(
|
| 82 |
+
fn=summarize_news,
|
| 83 |
+
inputs=["text", "number"],
|
| 84 |
outputs="text",
|
| 85 |
title="News Summarizer",
|
| 86 |
+
description="Enter a query to get summarized versions of the top news articles.",
|
| 87 |
+
example=[
|
| 88 |
+
["Python programming", 3],
|
| 89 |
+
["Artificial Intelligence", 5],
|
| 90 |
+
]
|
| 91 |
)
|
| 92 |
|
| 93 |
if __name__ == "__main__":
|