Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- model_dir="/mnt/Orlando/gguf"
- model_files=("$model_dir"/*.gguf)
- if [ ${#model_files[@]} -eq 0 ]; then
- echo "No .gguf files found in the specified directory."
- exit 1
- fi
- echo "Select a model file:"
- select model_file in "${model_files[@]}"; do
- if [ -n "$model_file" ]; then
- break
- else
- echo "Invalid selection. Please try again."
- fi
- done
- echo "Select context size (Press Enter to default to 8192):"
- options=("256" "512" "1024" "2048" "3072" "4096" "6144" "8192" "12288" "16384" "24576" "32768" "49152" "65536")
- PS3="Context: "
- select opt in "${options[@]}" ""; do
- case $REPLY in
- "")
- context="8192"
- echo "No context size selected. Defaulting to 8192."
- break
- ;;
- [0-9]*)
- if [[ $REPLY -ge 1 && $REPLY -le ${#options[@]} ]]; then
- context=${options[$REPLY-1]}
- echo "Selected context size: $context"
- break
- else
- echo "Invalid option. Please try again."
- fi
- ;;
- *)
- echo "Invalid input. Please enter a number."
- ;;
- esac
- done
- read -p "Enter gpu layers [999]: " layers_response
- layers=${layers_response:-999}
- read -p "Disable rowsplit? (y/[n]): " rowsplit_response
- rowsplit=$([ "$rowsplit_response" == "y" ] && echo "" || echo "rowsplit")
- if [ "$rowsplit" ]; then
- while true; do
- read -p "Enter tensor split [disabled]: " tensor_response
- if [[ "$tensor_response" == "" ]]; then
- tensor_split=""
- break
- elif [[ "$tensor_response" =~ ^[0-9]+(\.[0-9]+)?( [0-9]+(\.[0-9]+)?)*$ ]]; then
- tensor_split="--tensor_split $tensor_response"
- break
- else
- echo "Invalid response. Please enter a valid tensor split value (integers or floats separated by spaces)."
- fi
- done
- else
- tensor_split=""
- fi
- timestamp=$(date +"%Y%m%d%H%M%S")
- python ~/kbnew/koboldcpp/koboldcpp.py --usecublas $rowsplit --contextsize "$context" --gpulayers $layers --model "$model_file" $tensor_split --benchmark | tee "kbench-$timestamp.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement