Shreyas94 commited on
Commit
9a808f3
·
verified ·
1 Parent(s): 151e53b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -70,7 +70,7 @@ def summarize_news(query, num_results=3):
70
  continue
71
 
72
  logging.debug(f"Final summarized articles: {articles}")
73
- return articles
74
 
75
  def format_output(articles):
76
  formatted_text = ""
@@ -80,14 +80,10 @@ def format_output(articles):
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__":
 
70
  continue
71
 
72
  logging.debug(f"Final summarized articles: {articles}")
73
+ return format_output(articles)
74
 
75
  def format_output(articles):
76
  formatted_text = ""
 
80
 
81
  iface = gr.Interface(
82
  fn=summarize_news,
83
+ inputs=[gr.inputs.Textbox(label="Query"), gr.inputs.Slider(minimum=1, maximum=10, default=3, label="Number of Results")],
84
+ outputs=gr.outputs.Textbox(),
85
  title="News Summarizer",
86
+ description="Enter a query to get summarized versions of the top news articles."
 
 
 
 
87
  )
88
 
89
  if __name__ == "__main__":