mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 13:58:46 +01:00
scripts : parse wtype in server-llm.sh (#5167)
* scripts : parse wtype in server-llm.sh * scripts : fix check for wfile
This commit is contained in:
parent
2d40085c26
commit
e437b37fd0
@ -141,6 +141,28 @@ for wt in "${wtypes[@]}"; do
|
|||||||
wfiles+=("")
|
wfiles+=("")
|
||||||
done
|
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
|
# sample repos
|
||||||
repos=(
|
repos=(
|
||||||
"https://huggingface.co/TheBloke/Llama-2-7B-GGUF"
|
"https://huggingface.co/TheBloke/Llama-2-7B-GGUF"
|
||||||
@ -252,8 +274,10 @@ for file in $model_files; do
|
|||||||
printf " %2d) %s %s\n" $iw "$have" "$file"
|
printf " %2d) %s %s\n" $iw "$have" "$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
wfile="${wfiles[$wtype]}"
|
||||||
|
|
||||||
# ask for weights type until provided and available
|
# ask for weights type until provided and available
|
||||||
while [[ -z "$wtype" ]]; do
|
while [[ -z "$wfile" ]]; do
|
||||||
printf "\n"
|
printf "\n"
|
||||||
read -p "[+] Select weight type: " wtype
|
read -p "[+] Select weight type: " wtype
|
||||||
wfile="${wfiles[$wtype]}"
|
wfile="${wfiles[$wtype]}"
|
||||||
|
Loading…
Reference in New Issue
Block a user