#!/usr/bin/env python3 """ Hugging Face Space entry point for Vestiq Fashion Analyzer This file serves as the main entry point for the Hugging Face Space. """ import os import sys import uvicorn # Add the current directory to Python path sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) # Import the FastAPI app from fast import app # Ensure the app runs on the correct port for Hugging Face Spaces PORT = int(os.environ.get("PORT", 7860)) HOST = "0.0.0.0" # For Hugging Face Spaces, we need to make sure the app is available at module level # This allows HF to detect it properly application = app if __name__ == "__main__": print(f"Starting Vestiq Fashion Analyzer on {HOST}:{PORT}") print(f"Environment: {os.environ.get('SPACE_ID', 'local')}") uvicorn.run( app, host=HOST, port=PORT, log_level="info" )