miqu-control-vectors / patches /trainvector.sh
trollkotze's picture
Patches for llama.cpp and repeng to run this stuff.
6cd1d54 verified
raw
history blame
897 Bytes
#!/bin/bash
set -e
vname="$1";
if test -z "$vname" ; then
vname="control-vector";
else
vname="$1";
fi
echo "The name is '$vname'";
echo "Files will be stored in:";
echo ."./llama.cpp/vectors/"$vname".gguf"
echo "./llama.cpp/vectors/"$vname"_data.gguf"
echo "./llama.cpp/vectors/"$vname"_prompts.gguf"
cd repeng;
echo "Generating prompts..."
poetry run python emotion_prompts.py;
cd ../llama.cpp;
echo "Generating gguf data..."
./repeng -m models/miqu-1-70b.q5_K_M.gguf -f ../repeng/control_vector_prompts.txt --ctx_size 1024 -b 1024 -ub 1024 --threads 4 -ngl 40;
echo "Moving to repeng..."
mv control_vector_data.gguf ../repeng;
cd ../repeng;
poetry run python extract_vector.py;
mv control_vector.gguf "../llama.cpp/vectors/"$vname".gguf"
mv control_vector_data.gguf "../llama.cpp/vectors/"$vname"_data.gguf"
mv control_vector_prompts.txt "../llama.cpp/vectors/"$vname"_prompts.txt"
cd ..