#!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 " exit 1 fi # if ~/.config/llama-hf-to-q6_k.conf does not exist, create it if [ ! -f ~/.config/llama-hf-to-q6_k.conf ]; then cat < ~/.config/llama-hf-to-q6_k.conf MODELS_ROOT=~/.ai/models/llama/ HF_DOWNLOADER=~/.ai/bin/hfdownloader STORAGE_PATH=~/scratch/hfdownloader PYTHON3_EXEC=~/.virtualenvs/llama.cpp/bin/python3 QUANTIZE_EXEC=~/Work/llama.cpp/build/bin/quantize CONVERT_PY=~/Work/llama.cpp/convert.py EOF fi source ~/.config/llama-hf-to-q6_k.conf HF_NAME=$1 ACCOUNT_NAME=$(echo "$HF_NAME" | cut -d '/' -f 1) MODEL_NAME=$(echo "$HF_NAME" | cut -d '/' -f 2) MODEL_NAME_LOWER=$(echo "$MODEL_NAME" | tr '[:upper:]' '[:lower:]') MODEL_F16="$MODELS_ROOT/$ACCOUNT_NAME"/"$MODEL_NAME"/"${MODEL_NAME_LOWER}-f16.gguf" MODEL_Q6_K="$MODELS_ROOT/$ACCOUNT_NAME"/"$MODEL_NAME"/"${MODEL_NAME_LOWER}-q6_k.gguf" cat <