Spaces:
Sleeping
Sleeping
Download start.sh from ShutterStack/CausalBox: direct link, hf CLI and curl.
- Browser
- Download file 898 Bytes
-
https://huggingface.co/spaces/ShutterStack/CausalBox/resolve/847f2c77d966fdb51ee9072cb81de23fae00a0cf/start.sh
- Command line
-
hf download hf://spaces/ShutterStack/CausalBox@847f2c77d966fdb51ee9072cb81de23fae00a0cf/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/ShutterStack/CausalBox/resolve/847f2c77d966fdb51ee9072cb81de23fae00a0cf/start.sh
898 Bytes
| # Start Flask backend using Gunicorn in the background | |
| # Your main.py is at the root, so reference it correctly. | |
| echo "Starting Flask backend..." | |
| gunicorn main:app --workers 1 --bind 0.0.0.0:5000 --timeout 600 --log-level debug & | |
| # Wait a bit for Flask to start (optional, but can help prevent connection errors) | |
| sleep 5 | |
| # Start Streamlit frontend in the background | |
| # Ensure these flags are set for Streamlit to handle file uploads correctly in a proxied environment. | |
| echo "Starting Streamlit frontend..." | |
| streamlit run streamlit_app.py \ | |
| --server.port 8501 \ | |
| --server.enableCORS false \ | |
| --server.enableXsrfProtection false \ | |
| --server.fileWatcherType none & # Keep this for faster restarts if you have it | |
| # Wait a bit for Streamlit to start (optional) | |
| sleep 5 | |
| # Start Nginx in the foreground (important for Docker containers) | |
| echo "Starting Nginx..." | |
| nginx -g "daemon off;" |