safe-space2 / app.py
parthraninga's picture
Upload 66 files
a831961 verified
# SafeSpace AI API - Hugging Face Spaces Deployment
import os
import sys
import uvicorn
from pathlib import Path
# Add the current directory to Python path
sys.path.insert(0, str(Path(__file__).parent))
# Import the FastAPI app
from server.main import app
if __name__ == "__main__":
# Hugging Face Spaces uses port 7860
port = int(os.environ.get("PORT", 7860))
uvicorn.run(app, host="0.0.0.0", port=port)