Spaces:
Runtime error
Runtime error
Update startup.sh
Browse files- startup.sh +3 -3
startup.sh
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
set -e # Exit immediately if a command exits with a non-zero status.
|
5 |
|
6 |
echo "Starting Ollama server in the background..."
|
7 |
-
|
8 |
OLLAMA_PID=$! # Get PID of the backgrounded ollama serve
|
9 |
|
10 |
echo "Waiting for Ollama to be ready (http://127.0.0.1:11434)..."
|
@@ -29,7 +29,7 @@ echo "Models to pull from ENV: ${OLLAMA_PULL_MODELS}"
|
|
29 |
|
30 |
for model_name in ${OLLAMA_PULL_MODELS}; do
|
31 |
echo "Pulling model: ${model_name} (this may take several minutes)..."
|
32 |
-
|
33 |
if [ $? -eq 0 ]; then
|
34 |
echo "Model ${model_name} pulled successfully."
|
35 |
else
|
@@ -56,7 +56,7 @@ trap cleanup SIGINT SIGTERM
|
|
56 |
echo "Starting Gradio application (python app.py)..."
|
57 |
# Run python app.py in the foreground. It will now be PID 1 (or close to it)
|
58 |
# relative to this script, and signals will be handled by this script.
|
59 |
-
|
60 |
PYTHON_APP_PID=$!
|
61 |
|
62 |
wait $PYTHON_APP_PID # Wait for the python app to exit
|
|
|
4 |
set -e # Exit immediately if a command exits with a non-zero status.
|
5 |
|
6 |
echo "Starting Ollama server in the background..."
|
7 |
+
ollama serve > /tmp/ollama.log 2>&1 &
|
8 |
OLLAMA_PID=$! # Get PID of the backgrounded ollama serve
|
9 |
|
10 |
echo "Waiting for Ollama to be ready (http://127.0.0.1:11434)..."
|
|
|
29 |
|
30 |
for model_name in ${OLLAMA_PULL_MODELS}; do
|
31 |
echo "Pulling model: ${model_name} (this may take several minutes)..."
|
32 |
+
ollama pull "${model_name}"
|
33 |
if [ $? -eq 0 ]; then
|
34 |
echo "Model ${model_name} pulled successfully."
|
35 |
else
|
|
|
56 |
echo "Starting Gradio application (python app.py)..."
|
57 |
# Run python app.py in the foreground. It will now be PID 1 (or close to it)
|
58 |
# relative to this script, and signals will be handled by this script.
|
59 |
+
python app.py &
|
60 |
PYTHON_APP_PID=$!
|
61 |
|
62 |
wait $PYTHON_APP_PID # Wait for the python app to exit
|