| # Exit on any error | |
| set -e | |
| echo "π Starting Zouq-ul-ilm Notes Generator..." | |
| # Ensure output directory is writable (for notes.pdf) | |
| mkdir -p /app/tmp | |
| chmod 777 /app/tmp | |
| # Check if GROQ_API_KEY is set | |
| if [ -z "$GROQ_API_KEY" ]; then | |
| echo "β οΈ WARNING: GROQ_API_KEY is not set. Please add it in HuggingFace Space secrets." | |
| else | |
| echo "β GROQ_API_KEY found." | |
| fi | |
| echo "π Launching Streamlit app on port 7860..." | |
| # Start Streamlit | |
| exec streamlit run app.py \ | |
| --server.port=7860 \ | |
| --server.address=0.0.0.0 \ | |
| --server.headless=true \ | |
| --browser.gatherUsageStats=false |