Spaces:
Runtime error
Runtime error
File size: 567 Bytes
4d55dfd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#!/bin/bash
# Start Ollama in the background
ollama serve &
# Wait for Ollama to be ready (check if port 11434 is open)
echo "Waiting for Ollama to start..."
timeout 30s bash -c "until curl -s http://localhost:11434 > /dev/null; do sleep 1; done"
if [ $? -eq 0 ]; then
echo "Ollama is running."
else
echo "Failed to start Ollama within 30 seconds."
exit 1
fi
# Pull the model (llama3.2)
echo "Pulling llama3.2 model..."
ollama pull llama3.2
# Start Streamlit
echo "Starting Streamlit..."
streamlit run app.py --server.port 8501 --server.address 0.0.0.0 |