cognitive-ai-tutor / start.sh
codedawakening's picture
Create start.sh
72806e2 verified
Raw History Blame Contribute Delete
950 Bytes
#!/bin/bash
# Exit on error
set -e
echo "πŸš€ Starting Cognitive AI Tutor..."
# Start Ollama in background
echo "πŸ“₯ Starting Ollama service..."
ollama serve &
OLLAMA_PID=$!
# Wait for Ollama to be ready
echo "⏳ Waiting for Ollama to be ready..."
sleep 10
# Pull TinyLlama model (if not already present)
echo "πŸ“¦ Downloading TinyLlama model..."
ollama pull tinyllama || echo "Warning: Could not pull TinyLlama, continuing..."
# Pull Phi-2 as fallback (smaller, faster)
echo "πŸ“¦ Downloading Phi-2 model as fallback..."
ollama pull phi || echo "Warning: Could not pull Phi-2"
# Start the Streamlit app
echo "🌐 Starting Streamlit web interface..."
streamlit run app.py \
--server.port=7860 \
--server.address=0.0.0.0 \
--server.headless=true \
--server.enableCORS=false \
--server.enableXsrfProtection=false \
--theme.base="light" \
--browser.gatherUsageStats=false
# Keep container running
wait $OLLAMA_PID