Felipe97/llama-cpp-compiled
01.1k
1#!/usr/bin/env bash2 3set -e4 5QUANTIZED_MODEL="${1:-"$QUANTIZED_MODEL"}"6BUILD_DIR="${2:-"$BUILD_DIR"}"7 8if [ -z "$QUANTIZED_MODEL" ]; then9 echo "Error: Model path must be provided either as:" >&210 echo " 1. Command line argument" >&211 echo " 2. QUANTIZED_MODEL environment variable" >&212 exit 113fi14 15# Check if data/wikitext-2-raw directory exists16if [ ! -d "ppl/wikitext-2-raw" ]; then17 echo "ppl/wikitext-2-raw directory does not exist. Downloading..." >&218 mkdir -p ppl19 pushd ppl20 ./../../../scripts/get-wikitext-2.sh21 popd22fi23 24if [ -z "$BUILD_DIR" ]; then25 BUILD_DIR="../../build"26fi27 28cmake --build $BUILD_DIR --target llama-perplexity -j829 30${BUILD_DIR}/bin/llama-perplexity -m $QUANTIZED_MODEL -f ppl/wikitext-2-raw/wiki.test.raw31 32 33 