File size: 472 Bytes
ea6f215
 
 
 
 
c837a1b
 
ea6f215
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)