Spaces:
Build error
Build error
| import gradio as gr | |
| # Function to handle user input and provide output | |
| def get_popular_trend(activity): | |
| trends = { | |
| "coding": "Most popular coding languages right now are Python, JavaScript, and Go.", | |
| "gaming": "Popular gaming titles include The Legend of Zelda: Tears of the Kingdom, Baldur's Gate 3, and Final Fantasy XVI.", | |
| "reading": "Popular books are 'Fourth Wing' by Rebecca Yarros, 'Happy Place' by Emily Henry, and 'Iron Flame' by Rebecca Yarros.", | |
| "movies": "Trending movies are 'Barbie', 'Oppenheimer', and 'Mission: Impossible – Dead Reckoning Part One'.", | |
| "music": "Top songs include 'As It Was' by Harry Styles, 'Levitating' by Dua Lipa, and 'Bad Habits' by Ed Sheeran.", | |
| "sports": "Popular sports right now are soccer, basketball, and tennis.", | |
| "travel": "Trending travel destinations include Bali, Paris, and Tokyo.", | |
| "tech": "Hot tech trends include AI advancements, electric vehicles, and quantum computing.", | |
| "food": "Trending food items include sushi, tacos, and avocado toast.", | |
| "fashion": "Current fashion trends include oversized blazers, chunky sneakers, and pastel colors." | |
| } | |
| return trends.get(activity.lower(), "Sorry, I don't have information on that activity right now.") | |
| # Create the Gradio interface | |
| iface = gr.Interface( | |
| fn=get_popular_trend, | |
| inputs="text", | |
| outputs="text", | |
| title="What's Popular Right Now?", | |
| description="Input an activity (like coding, gaming, etc.), and get the latest popular trends!" | |
| ) | |
| # Launch the interface | |
| iface.launch() |