Spaces:
Sleeping
Sleeping
| #!/usr/bin/env python3 | |
| """Vercel serverless endpoint for Heavy 2.0.""" | |
| import os | |
| import sys | |
| # Add parent directory to path to import src modules | |
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| # Disable analytics and API info for serverless | |
| os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" | |
| os.environ["GRADIO_DISABLE_API_INFO"] = "1" | |
| # Import the Gradio demo | |
| from src.multi_web_combined import demo | |
| # Create the ASGI app that Vercel will use | |
| app = demo.app | |
| def handler(event, context): | |
| """ | |
| Vercel serverless handler. | |
| Note: Gradio apps work best on persistent servers. | |
| For production, consider Hugging Face Spaces or Railway. | |
| """ | |
| return app(event, context) | |