Download app.py from sp103107/skatingP: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/sp103107/skatingP/resolve/main/app.py
- Command line
-
hf download hf://spaces/sp103107/skatingP/app.py
-
curl -L -o app.py https://huggingface.co/spaces/sp103107/skatingP/resolve/main/app.py
1.01 kB
| import asyncio | |
| import logging | |
| from datetime import datetime | |
| import gradio as gr | |
| from agents import dispatch_agent # Import from dispatcher.py | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| filename="dispatcher_agent.log", | |
| filemode="a", | |
| format="%(asctime)s - %(levelname)s - %(message)s", | |
| ) | |
| # Create the Gradio interface | |
| iface = gr.Interface( | |
| fn=lambda birthdate, location_born, current_city, personality_type: asyncio.run( | |
| dispatch_agent(birthdate, location_born, current_city, personality_type) | |
| ), | |
| inputs=[ | |
| gr.Date(label="Birthdate"), | |
| gr.Textbox(label="Location of Birth"), | |
| gr.Textbox(label="Current City"), | |
| gr.Textbox(label="Personality Type"), | |
| ], | |
| outputs=gr.Textbox(label="Horoscope"), | |
| title="✨ Your Daily Horoscope ✨", # Add a title | |
| description="Get your personalized horoscope based on your birthdate, location, and personality.", # Add a description | |
| ) | |
| # Launch the interface | |
| iface.launch() |