18 lines
328 B
Bash
Executable File
18 lines
328 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
|
|
IFS=',' read -r -a models_arr <<< "${MODELS}"
|
|
|
|
## now loop through the above array
|
|
for m in "${models_arr[@]}"
|
|
do
|
|
ollama list | tail -n +2 | cut -d' ' -f1 | grep ${m} > /dev/null
|
|
if [[ $? -ne 0 ]]
|
|
then
|
|
echo "download {m}"
|
|
ollama pull "${m}"
|
|
else
|
|
echo "${m} already installed"
|
|
fi
|
|
done
|