scripts : parse wtype in server-llm.sh

This commit is contained in:
Georgi Gerganov 2024-01-28 10:06:38 +02:00
parent 6db2b41a76
commit fb75fc04e1
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -141,6 +141,28 @@ for wt in "${wtypes[@]}"; do
wfiles+=("")
done
# map wtype input to index
if [[ ! -z "$wtype" ]]; then
iw=-1
is=0
for wt in "${wtypes[@]}"; do
# uppercase
uwt=$(echo "$wt" | tr '[:lower:]' '[:upper:]')
if [[ "$uwt" == "$wtype" ]]; then
iw=$is
break
fi
is=$((is+1))
done
if [[ $iw -eq -1 ]]; then
printf "[-] Invalid weight type: %s\n" "$wtype"
exit 1
fi
wtype="$iw"
fi
# sample repos
repos=(
"https://huggingface.co/TheBloke/Llama-2-7B-GGUF"