Download examples/model-conversion/scripts/utils/perplexity-run-simple.sh from Brunobkr/llama.cpp_AlgMor24_github: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github/resolve/9f63da05cd17e144eb118af61a784286378961ba/examples/model-conversion/scripts/utils/perplexity-run-simple.sh
- Command line
-
hf download hf://datasets/Brunobkr/llama.cpp_AlgMor24_github@9f63da05cd17e144eb118af61a784286378961ba/examples/model-conversion/scripts/utils/perplexity-run-simple.sh
-
curl -L -o perplexity-run-simple.sh https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github/resolve/9f63da05cd17e144eb118af61a784286378961ba/examples/model-conversion/scripts/utils/perplexity-run-simple.sh
770 Bytes
| set -e | |
| QUANTIZED_MODEL="${1:-"$QUANTIZED_MODEL"}" | |
| BUILD_DIR="${2:-"$BUILD_DIR"}" | |
| if [ -z "$QUANTIZED_MODEL" ]; then | |
| echo "Error: Model path must be provided either as:" >&2 | |
| echo " 1. Command line argument" >&2 | |
| echo " 2. QUANTIZED_MODEL environment variable" >&2 | |
| exit 1 | |
| fi | |
| # Check if data/wikitext-2-raw directory exists | |
| if [ ! -d "ppl/wikitext-2-raw" ]; then | |
| echo "ppl/wikitext-2-raw directory does not exist. Downloading..." >&2 | |
| mkdir -p ppl | |
| pushd ppl | |
| ./../../../scripts/get-wikitext-2.sh | |
| popd | |
| fi | |
| if [ -z "$BUILD_DIR" ]; then | |
| BUILD_DIR="../../build" | |
| fi | |
| cmake --build $BUILD_DIR --target llama-perplexity -j8 | |
| ${BUILD_DIR}/bin/llama-perplexity -m $QUANTIZED_MODEL -f ppl/wikitext-2-raw/wiki.test.raw | |