Spaces:
Running
Running
Download app.py from claessonlab/Taxonova: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/spaces/claessonlab/Taxonova/resolve/main/app.py
- Command line
-
hf download hf://spaces/claessonlab/Taxonova/app.py
-
curl -L -o app.py https://huggingface.co/spaces/claessonlab/Taxonova/resolve/main/app.py
698 Bytes
| """ | |
| Hugging Face Spaces wrapper for Taxonova FastAPI application. | |
| This file is the entry point for deployment on Hugging Face Spaces. | |
| """ | |
| import os | |
| import sys | |
| from pathlib import Path | |
| # Add the current directory and webapp directory to Python path | |
| current_dir = Path(__file__).parent | |
| sys.path.insert(0, str(current_dir)) | |
| sys.path.insert(0, str(current_dir / "webapp")) | |
| # Import the FastAPI app from webapp/app.py | |
| from webapp.app import app | |
| # For Hugging Face Spaces, we need to run on port 7860 | |
| if __name__ == "__main__": | |
| import uvicorn | |
| # Hugging Face Spaces expects the app to run on port 7860 | |
| port = int(os.environ.get("PORT", 7860)) | |
| uvicorn.run(app, host="0.0.0.0", port=port) |