Spaces:
Sleeping
Sleeping
Download app.py from parthraninga/safe-space2: direct link, hf CLI and curl.
- Browser
- Download file 436 Bytes
-
https://huggingface.co/spaces/parthraninga/safe-space2/resolve/main/app.py
- Command line
-
hf download hf://spaces/parthraninga/safe-space2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/parthraninga/safe-space2/resolve/main/app.py
436 Bytes
| # 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) | |