Spaces:
Running
Running
| import os | |
| import logging | |
| from main import app | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" | |
| ) | |
| logger = logging.getLogger(__name__) | |
| if __name__ == "__main__": | |
| # Get port from environment (Hugging Face Spaces uses 7860) | |
| port = int(os.environ.get("PORT", 7860)) | |
| logger.info(f"Starting Tattoo Search Engine on port {port}") | |
| logger.info("Available endpoints:") | |
| logger.info(" POST /search - Search for similar tattoos") | |
| logger.info(" POST /analyze-attention - Analyze patch-level attention") | |
| logger.info(" GET /models - Get available embedding models") | |
| logger.info(" GET /health - Health check") | |
| import uvicorn | |
| uvicorn.run( | |
| app, | |
| host="0.0.0.0", | |
| port=port, | |
| log_level="info", | |
| access_log=True | |
| ) |