File size: 489 Bytes
9a03fcf
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
# This script runs when the HuggingFace space starts

# Set environment variables
export FLASK_APP=app.py
export FLASK_ENV=production

# Start the Flask application with gunicorn
# - workers: Number of worker processes (2-4 x CPU cores is recommended)
# - timeout: Worker timeout in seconds
# - access-logfile: Log access to stdout
# - error-logfile: Log errors to stderr
exec gunicorn --workers=2 --timeout=120 --bind 0.0.0.0:5000 --access-logfile=- --error-logfile=- app:app