mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-27 08:21:30 +00:00
* model-conversion : remove hardcoded /bin/bash shebangs [no ci] This commit updates the bash scripts to use env instead of using hardcoded /bin/bash in the shebang line. The motivation for this is that some systems may have bash installed in a different location, and using /usr/bin/env bash ensures that the script will use the first bash interpreter found in the user's PATH, making the scripts more portable across different environments. * model-conversion : rename script to .py [no ci] This commit renames run-casual-gen-embeddings-org.sh to run-casual-gen-embeddings-org.py to reflect its Python nature.
29 lines
716 B
Bash
Executable File
29 lines
716 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
QUANTIZED_MODEL="${1:-"$QUANTIZED_MODEL"}"
|
|
LOGITS_FILE="${1:-"$LOGITS_FILE"}"
|
|
|
|
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
|
|
|
|
if [ ! -f ${LOGITS_FILE} ]; then
|
|
echo "Error: logits file '${LOGITS_FILE} was not found"
|
|
echo "Did you run the perplexity-gen.sh script?"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Model: $QUANTIZED_MODEL"
|
|
echo "Data file: $LOGITS_FILE"
|
|
|
|
cmake --build ../../build --target llama-perplexity -j8
|
|
|
|
../.././build/bin/llama-perplexity -m $QUANTIZED_MODEL \
|
|
--kl-divergence-base $LOGITS_FILE \
|
|
--kl-divergence
|