Spaces:
Build error
Build error
File size: 621 Bytes
d6611b3 ed775de 22258cd ed775de d6611b3 ed775de 5ad3a62 d6611b3 ed775de |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#!/bin/bash
# Function to pull and run a model
pull_and_run_model() {
local model_name=$1
echo "Pulling $model_name"
ollama pull "$model_name"
echo "Running $model_name"
ollama run "$model_name" --keepalive -1s &
}
# Starting server
echo "Starting server"
ollama serve &
sleep 5 # Allowing time for the server to start
# Splitting the models by comma and processing each
IFS=',' read -ra MODELS <<< "$model"
for m in "${MODELS[@]}"; do
pull_and_run_model "$m"
sleep 5 # Optional: Delay between starting each model
done
# Keep the script running to prevent the container from exiting
wait |