1
0

perplexity-run-simple.sh 672 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -e
  3. QUANTIZED_MODEL="${1:-"$QUANTIZED_MODEL"}"
  4. if [ -z "$QUANTIZED_MODEL" ]; then
  5. echo "Error: Model path must be provided either as:" >&2
  6. echo " 1. Command line argument" >&2
  7. echo " 2. QUANTIZED_MODEL environment variable" >&2
  8. exit 1
  9. fi
  10. # Check if data/wikitext-2-raw directory exists
  11. if [ ! -d "ppl/wikitext-2-raw" ]; then
  12. echo "ppl/wikitext-2-raw directory does not exist. Downloading..." >&2
  13. mkdir -p ppl
  14. pushd ppl
  15. ./../../../scripts/get-wikitext-2.sh
  16. popd
  17. fi
  18. cmake --build ../../build --target llama-perplexity -j8
  19. ../.././build/bin/llama-perplexity -m $QUANTIZED_MODEL -f ppl/wikitext-2-raw/wiki.test.raw