Spaces:
Sleeping
Sleeping
| # 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) | |