UI spruce up
Browse files
app.py
CHANGED
@@ -111,7 +111,7 @@ def fetch_news():
|
|
111 |
return f"Error: Failed to fetch news. Status code: {response.status_code}"
|
112 |
|
113 |
articles = response.json().get("articles", [])
|
114 |
-
summaries = []
|
115 |
for article in articles:
|
116 |
title = article.get("title", "No title")
|
117 |
article_url = article.get("url", "#")
|
@@ -141,36 +141,30 @@ def extract_full_content(url):
|
|
141 |
with gr.Blocks(theme=gr.themes.Default(font="Arial", font_mono="Courier New")) as demo:
|
142 |
# Header Section
|
143 |
gr.Markdown("# 📰 Sum Up! Stay Informed, Instantly")
|
144 |
-
gr.Markdown("
|
145 |
-
gr.Markdown(
|
146 |
-
"Sum Up! condenses the latest headlines from trusted news sources into clear, concise, and easy-to-read summaries, so you can stay informed in seconds."
|
147 |
-
)
|
148 |
|
149 |
# Input Section
|
150 |
gr.Markdown("---") # Horizontal line for separation
|
151 |
with gr.Row():
|
152 |
# Left Column: Collapsible Sidebar for Latest News
|
153 |
with gr.Column(scale=1, min_width=300):
|
154 |
-
with gr.Accordion("📢
|
155 |
gr.Markdown("**Source: Associated Press**")
|
156 |
gr.Markdown(
|
157 |
-
"Click
|
158 |
-
)
|
159 |
-
news_btn = gr.Button("🗞️ News Now", variant="primary", elem_id="news-now-btn")
|
160 |
-
gr.Markdown(
|
161 |
-
"This feature fetches the latest headlines from the Associated Press and summarizes them for you."
|
162 |
-
)
|
163 |
|
164 |
# Right Column: Text Input and File Upload
|
165 |
with gr.Column(scale=2, min_width=400):
|
166 |
-
gr.Markdown("### Provide
|
167 |
gr.Markdown("#### Enter Text or URL")
|
168 |
input_box = gr.Textbox(
|
169 |
label="Enter URL or Text",
|
170 |
placeholder="Paste a URL or text here...",
|
171 |
lines=5,
|
172 |
)
|
173 |
-
summarize_btn = gr.Button("
|
174 |
|
175 |
# Clear Button placed below the Summarize button
|
176 |
clear_btn = gr.Button("Clear", variant="secondary", elem_id="clear-btn")
|
@@ -183,7 +177,7 @@ with gr.Blocks(theme=gr.themes.Default(font="Arial", font_mono="Courier New")) a
|
|
183 |
|
184 |
# Output Section
|
185 |
gr.Markdown("---") # Horizontal line for separation
|
186 |
-
gr.Markdown("###
|
187 |
with gr.Row():
|
188 |
with gr.Column(scale=1):
|
189 |
gen_output = gr.Markdown() # Use a valid output component
|
|
|
111 |
return f"Error: Failed to fetch news. Status code: {response.status_code}"
|
112 |
|
113 |
articles = response.json().get("articles", [])
|
114 |
+
summaries = [f'## 📰 Top Stories - Instant Insights\n\n']
|
115 |
for article in articles:
|
116 |
title = article.get("title", "No title")
|
117 |
article_url = article.get("url", "#")
|
|
|
141 |
with gr.Blocks(theme=gr.themes.Default(font="Arial", font_mono="Courier New")) as demo:
|
142 |
# Header Section
|
143 |
gr.Markdown("# 📰 Sum Up! Stay Informed, Instantly")
|
144 |
+
gr.Markdown("### FLAN-T5-Driven Summarizer for Multi-Format Content")
|
145 |
+
gr.Markdown("Sum Up! effectively distills lengthy content into clear, concise summaries with just a text input, file upload, or URL. Stay informed with instant access to auto-summarized top news headlines—all in just one click.")
|
|
|
|
|
146 |
|
147 |
# Input Section
|
148 |
gr.Markdown("---") # Horizontal line for separation
|
149 |
with gr.Row():
|
150 |
# Left Column: Collapsible Sidebar for Latest News
|
151 |
with gr.Column(scale=1, min_width=300):
|
152 |
+
with gr.Accordion("📢 News at a Glance", open=False):
|
153 |
gr.Markdown("**Source: Associated Press**")
|
154 |
gr.Markdown(
|
155 |
+
"Click to get today's top news from the Associated Press, simplified and ready to read.")
|
156 |
+
news_btn = gr.Button("⚡ News Now", variant="primary", elem_id="news-now-btn")
|
|
|
|
|
|
|
|
|
157 |
|
158 |
# Right Column: Text Input and File Upload
|
159 |
with gr.Column(scale=2, min_width=400):
|
160 |
+
gr.Markdown("### Provide content to summarize")
|
161 |
gr.Markdown("#### Enter Text or URL")
|
162 |
input_box = gr.Textbox(
|
163 |
label="Enter URL or Text",
|
164 |
placeholder="Paste a URL or text here...",
|
165 |
lines=5,
|
166 |
)
|
167 |
+
summarize_btn = gr.Button("🔍 Summarize", variant="primary", elem_id="summarize-btn")
|
168 |
|
169 |
# Clear Button placed below the Summarize button
|
170 |
clear_btn = gr.Button("Clear", variant="secondary", elem_id="clear-btn")
|
|
|
177 |
|
178 |
# Output Section
|
179 |
gr.Markdown("---") # Horizontal line for separation
|
180 |
+
gr.Markdown("### 💡 Key Takeaways")
|
181 |
with gr.Row():
|
182 |
with gr.Column(scale=1):
|
183 |
gen_output = gr.Markdown() # Use a valid output component
|