File size: 844 Bytes
d7ed1ea
 
 
 
 
 
 
 
e4e7a94
d7ed1ea
 
e4e7a94
 
 
 
d7ed1ea
 
 
e4e7a94
 
 
 
 
 
 
d7ed1ea
 
 
 
e4e7a94
d7ed1ea
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
29
30
31
#!/usr/bin/env python3
"""
Hugging Face Spaces Entry Point
This is the main entry point for Hugging Face Spaces deployment
"""

import os
import sys
import logging
from pathlib import Path

# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# Add the current directory to Python path
sys.path.insert(0, str(Path(__file__).parent))

try:
    # Import the FastAPI app from main.py
    from main import app
    logger.info("βœ… Successfully imported FastAPI app from main.py")
except Exception as e:
    logger.error(f"❌ Failed to import FastAPI app: {e}")
    raise

# For Hugging Face Spaces, we need to expose the app directly
if __name__ == "__main__":
    import uvicorn
    logger.info("πŸš€ Starting Unified Assistant on Hugging Face Spaces")
    uvicorn.run(app, host="0.0.0.0", port=7860)