Spaces:
Running

Taxonova / app.py
claessonlab's picture
Upload 142 files
9db9bd0 verified
Raw History Blame Contribute Delete
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)