Shreyas94 commited on
Commit
151e53b
1 Parent(s): c19b837

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
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=lambda query, num_results: format_output(summarize_news(query, num_results)),
83
- inputs=[gr.inputs.Textbox(label="Query"), gr.inputs.Slider(minimum=1, maximum=10, default=3, label="Number of Results")],
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__":