Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Audio URLs
|
4 |
+
AUDIO_URLS = {
|
5 |
+
"Money": "https://pub-6dc43089a07d4218adb4b0579b3be0b9.r2.dev/News/News_Money.wav",
|
6 |
+
"Geopolitical": "https://pub-6dc43089a07d4218adb4b0579b3be0b9.r2.dev/News/News_Geopolitical.wav",
|
7 |
+
"World": "https://pub-6dc43089a07d4218adb4b0579b3be0b9.r2.dev/News/News_World.wav",
|
8 |
+
"Entertainment": "https://pub-6dc43089a07d4218adb4b0579b3be0b9.r2.dev/News/News_Entertainment.wav",
|
9 |
+
"Health": "https://pub-6dc43089a07d4218adb4b0579b3be0b9.r2.dev/News/News_Health.wav",
|
10 |
+
"Sports": "https://pub-6dc43089a07d4218adb4b0579b3be0b9.r2.dev/News/News_Sports.wav"
|
11 |
+
}
|
12 |
+
|
13 |
+
def create_news_dashboard():
|
14 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
15 |
+
gr.Markdown(
|
16 |
+
"""
|
17 |
+
# π» Radio News Dashboard
|
18 |
+
### Listen to the latest news updates across different categories
|
19 |
+
"""
|
20 |
+
)
|
21 |
+
|
22 |
+
with gr.Grid(rows=2, cols=3):
|
23 |
+
with gr.Column():
|
24 |
+
gr.Markdown("### π° Money News")
|
25 |
+
gr.Audio(AUDIO_URLS["Money"], autoplay=False, label="Financial Updates")
|
26 |
+
|
27 |
+
with gr.Column():
|
28 |
+
gr.Markdown("### π Geopolitical News")
|
29 |
+
gr.Audio(AUDIO_URLS["Geopolitical"], autoplay=False, label="Global Politics")
|
30 |
+
|
31 |
+
with gr.Column():
|
32 |
+
gr.Markdown("### π World News")
|
33 |
+
gr.Audio(AUDIO_URLS["World"], autoplay=False, label="World Updates")
|
34 |
+
|
35 |
+
with gr.Column():
|
36 |
+
gr.Markdown("### π Entertainment")
|
37 |
+
gr.Audio(AUDIO_URLS["Entertainment"], autoplay=False, label="Entertainment News")
|
38 |
+
|
39 |
+
with gr.Column():
|
40 |
+
gr.Markdown("### π₯ Health News")
|
41 |
+
gr.Audio(AUDIO_URLS["Health"], autoplay=False, label="Health Updates")
|
42 |
+
|
43 |
+
with gr.Column():
|
44 |
+
gr.Markdown("### π Sports News")
|
45 |
+
gr.Audio(AUDIO_URLS["Sports"], autoplay=False, label="Sports Updates")
|
46 |
+
|
47 |
+
gr.Markdown(
|
48 |
+
"""
|
49 |
+
---
|
50 |
+
### π Note: Click on any player to listen to the corresponding news segment
|
51 |
+
"""
|
52 |
+
)
|
53 |
+
|
54 |
+
return demo
|
55 |
+
|
56 |
+
if __name__ == "__main__":
|
57 |
+
demo = create_news_dashboard()
|
58 |
+
demo.launch()
|