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