Spaces:
Sleeping
Sleeping
Create entrypoint.sh
Browse files- entrypoint.sh +17 -0
entrypoint.sh
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Start Ollama server in the background
|
| 4 |
+
ollama serve --port 7860 &
|
| 5 |
+
|
| 6 |
+
# Wait for the server to be ready
|
| 7 |
+
while ! nc -z localhost 7860; do
|
| 8 |
+
echo "Waiting for Ollama server to start..."
|
| 9 |
+
sleep 1
|
| 10 |
+
done
|
| 11 |
+
|
| 12 |
+
# Pull the model
|
| 13 |
+
echo "Pulling the model..."
|
| 14 |
+
ollama pull steamdj/llama3.1-cpu-only
|
| 15 |
+
|
| 16 |
+
# Keep the container running
|
| 17 |
+
wait
|