Spaces:
Sleeping
Sleeping
File size: 719 Bytes
ea81a05 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#!/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)
|