Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -186,13 +186,16 @@ def fetch_and_edit_news(topic, language, search_date):
|
|
186 |
print(error_details)
|
187 |
return f"Error processing your request: {str(e)}\n\nPlease check that your OpenAI API key is correctly set in the repository secrets."
|
188 |
|
189 |
-
# Create Gradio interface
|
190 |
-
with gr.Blocks(title="Multilingual AI News Generator") as demo:
|
191 |
gr.Markdown("# Multilingual AI News Generator")
|
192 |
gr.Markdown("Enter a topic, select a language, and choose a date to receive curated and edited news articles")
|
193 |
|
194 |
with gr.Row():
|
195 |
-
topic_input = gr.Textbox(
|
|
|
|
|
|
|
196 |
language_dropdown = gr.Dropdown(
|
197 |
choices=[
|
198 |
"English", "Hindi", "Spanish", "French", "German",
|
@@ -203,12 +206,12 @@ with gr.Blocks(title="Multilingual AI News Generator") as demo:
|
|
203 |
label="Language",
|
204 |
value="English"
|
205 |
)
|
206 |
-
date_picker = gr.
|
207 |
label="Search Date",
|
208 |
-
placeholder="YYYY-MM-DD",
|
209 |
value=default_date
|
210 |
)
|
211 |
-
|
|
|
212 |
|
213 |
output_box = gr.Textbox(label="Generated News Article", lines=20)
|
214 |
|
|
|
186 |
print(error_details)
|
187 |
return f"Error processing your request: {str(e)}\n\nPlease check that your OpenAI API key is correctly set in the repository secrets."
|
188 |
|
189 |
+
# Create Gradio interface with a theme
|
190 |
+
with gr.Blocks(title="Multilingual AI News Generator", theme=gr.themes.Soft(primary_hue="blue")) as demo:
|
191 |
gr.Markdown("# Multilingual AI News Generator")
|
192 |
gr.Markdown("Enter a topic, select a language, and choose a date to receive curated and edited news articles")
|
193 |
|
194 |
with gr.Row():
|
195 |
+
topic_input = gr.Textbox(
|
196 |
+
label="News Topic",
|
197 |
+
placeholder="Enter a topic (e.g., AI, Climate Change, Sports)"
|
198 |
+
)
|
199 |
language_dropdown = gr.Dropdown(
|
200 |
choices=[
|
201 |
"English", "Hindi", "Spanish", "French", "German",
|
|
|
206 |
label="Language",
|
207 |
value="English"
|
208 |
)
|
209 |
+
date_picker = gr.Datepicker(
|
210 |
label="Search Date",
|
|
|
211 |
value=default_date
|
212 |
)
|
213 |
+
|
214 |
+
submit_btn = gr.Button("Generate News Article", variant="primary")
|
215 |
|
216 |
output_box = gr.Textbox(label="Generated News Article", lines=20)
|
217 |
|