Spaces:
Sleeping
Sleeping
File size: 874 Bytes
ff1a300 82ec91b ff1a300 82ec91b ff1a300 82ec91b ff1a300 82ec91b ff1a300 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#!/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"
)
|