Spaces:
Running
Running
Update run.sh
Browse files
run.sh
CHANGED
|
@@ -1,25 +1,16 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
set -e
|
| 5 |
-
|
| 6 |
-
# Start the Ollama server in the background.
|
| 7 |
-
# The OLLAMA_HOST environment variable is already set in the Dockerfile, so it will listen on all interfaces.
|
| 8 |
ollama serve &
|
| 9 |
|
| 10 |
-
# Wait for the
|
| 11 |
-
|
| 12 |
-
while ! curl -s http://localhost:11434 > /dev/null; do
|
| 13 |
-
sleep 1
|
| 14 |
-
done
|
| 15 |
-
echo "Ollama started."
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
-
ollama
|
| 21 |
-
echo "Model created."
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Start the Ollama server in the background
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
ollama serve &
|
| 5 |
|
| 6 |
+
# Wait a few seconds for the server to be fully operational
|
| 7 |
+
sleep 5
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Pull the model from Hugging Face.
|
| 10 |
+
# This command downloads the model and makes it available to the API.
|
| 11 |
+
# It's the non-interactive version of "ollama run".
|
| 12 |
+
ollama pull hf.co/unsloth/gemma-3-4b-it-qat-GGUF:Q4_K_M
|
|
|
|
| 13 |
|
| 14 |
+
# Start the Gradio web application
|
| 15 |
+
# This will connect to the Ollama server which is already running.
|
| 16 |
+
python3 app.py
|