From 9346c1ae69217e29d694b44d94238ce166ad99f9 Mon Sep 17 00:00:00 2001 From: MeaTLoTioN Date: Thu, 3 Apr 2025 12:17:04 +0100 Subject: [PATCH] Update installer again --- install.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 39012fc..172abdb 100755 --- a/install.sh +++ b/install.sh @@ -11,10 +11,10 @@ installAll(){ for file in */*; do res=$(checkExists $(basename $file)) if [[ $? -lt 1 ]]; then - echo "Installing model: $(basename $file)" + echo "Installing model: $(basename $file)" ollama create $(basename ${file}) -f ${file} else - echo "$(basename $file) already exists, skipping." + echo "$(basename $file) already exists, skipping." fi done } @@ -23,21 +23,28 @@ installFile(){ res=$(checkExists $(basename $1)) if [[ $? -lt 1 ]]; then if [[ -f $1 ]]; then - echo "Installing model file: $1" + echo "Installing model file: $1" ollama create $(basename $1) -f $1 else - echo "File not found, aborting!" + echo "File $1 not found, aborting!" fi else - echo "$(basename $1) already exists, skipped." + echo "$(basename $1) already exists, skipped." fi } listFiles(){ + echo "Listing available model files..." + echo [[ $1 ]] && CAT=$1 || CAT="*" + (echo "Model Name Modelfile" for file in ${CAT}/*; do - echo "$file" - done + echo -e "$(basename $file)\t$file" + done) | column -t -s ' ' + echo + echo -e "To install one, run $0 modelfile\nTo install all, run $0 all\n" + echo "Example; $0 startrek/Jean-Luc_Picard" + echo } checkExists(){