Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Function to handle user input and provide output
|
4 |
+
def get_popular_trend(activity):
|
5 |
+
trends = {
|
6 |
+
"coding": "Most popular coding languages right now are Python, JavaScript, and Go.",
|
7 |
+
"gaming": "Popular gaming titles include The Legend of Zelda: Tears of the Kingdom, Baldur's Gate 3, and Final Fantasy XVI.",
|
8 |
+
"reading": "Popular books are 'Fourth Wing' by Rebecca Yarros, 'Happy Place' by Emily Henry, and 'Iron Flame' by Rebecca Yarros.",
|
9 |
+
"movies": "Trending movies are 'Barbie', 'Oppenheimer', and 'Mission: Impossible – Dead Reckoning Part One'.",
|
10 |
+
"music": "Top songs include 'As It Was' by Harry Styles, 'Levitating' by Dua Lipa, and 'Bad Habits' by Ed Sheeran."
|
11 |
+
}
|
12 |
+
|
13 |
+
return trends.get(activity.lower(), "Sorry, I don't have information on that activity right now.")
|
14 |
+
|
15 |
+
# Create the Gradio interface
|
16 |
+
iface = gr.Interface(
|
17 |
+
fn=get_popular_trend,
|
18 |
+
inputs="text",
|
19 |
+
outputs="text",
|
20 |
+
title="What's Popular Right Now?",
|
21 |
+
description="Input an activity (like coding, gaming, etc.), and get the latest popular trends!"
|
22 |
+
)
|
23 |
+
|
24 |
+
# Launch the interface
|
25 |
+
iface.launch()
|