#!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 " exit 1 fi # if $HOME/.config/llama-hf-to-q6_k.conf does not exist, create it if [ ! -f $HOME/.config/llama/llama-hf-to-q6_k.conf ]; then mkdir -p $HOME/.config/llama cat < $HOME/.config/llama/llama-hf-to-q6_k.conf MODELS_ROOT=$HOME/.ai/models/llama/ HF_DOWNLOADER=$HOME/.ai/bin/hfdownloader STORAGE_PATH=$HOME/scratch/hfdownloader PYTHON3_EXEC=$HOME/.virtualenvs/llama.cpp/bin/python3 QUANTIZE_EXEC=$HOME/Work/llama.cpp/build/bin/quantize CONVERT_PY=$HOME/Work/llama.cpp/convert.py EOF fi source $HOME/.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 <