Rossmann-Store-Sales / scripts /run_api_local.py
ymlin105's picture
Refactor: Move app.py to scripts/ and configure Docker deployment to fix HF build
c837a1b
raw
history blame contribute delete
472 Bytes
import uvicorn
import os
import sys
# Ensure the root directory is in the path for internal imports
# Since this script is in scripts/, we need to go up one level
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from fastapi_app.main import app
if __name__ == "__main__":
# Hugging Face Spaces expects the app to run on port 7860 by default
port = int(os.environ.get("PORT", 7860))
uvicorn.run(app, host="0.0.0.0", port=port)