Spaces:
Sleeping
Sleeping
Download start.sh from codedawakening/cognitive-ai-tutor: direct link, hf CLI and curl.
- Browser
- Download file 950 Bytes
-
https://huggingface.co/spaces/codedawakening/cognitive-ai-tutor/resolve/main/start.sh
- Command line
-
hf download hf://spaces/codedawakening/cognitive-ai-tutor/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/codedawakening/cognitive-ai-tutor/resolve/main/start.sh
950 Bytes
| # 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 |