]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
model-conversion : use CONVERTED_MODEL for compare-embeddings (#18461)
authorDaniel Bevenius <redacted>
Tue, 30 Dec 2025 09:13:12 +0000 (10:13 +0100)
committerGitHub <redacted>
Tue, 30 Dec 2025 09:13:12 +0000 (10:13 +0100)
This commit updates the causal model verification script to use the
CONVERTED_MODEL environment variable instead of using the MODEL_PATH
(the original model path) as the basis for the converted model file
name.

The motivation for this that currently if the converted model file name
differs from the original model directory/name the verification script
will look for the wrong .bin file that was generating when running
the converted model.

This similar to the change made for the embeddings models script in
Commit db81d5ec4b0a9cb19e98c4533731c9554eb025db ("model-conversion :
use CONVERTED_EMBEDDING_MODEL for embedding_verify_logits (#18079)"),
but we also verify the embeddings of for causal models as well.

examples/model-conversion/scripts/causal/compare-embeddings-logits.sh

index c53c89d48acc6049b4478749ebe5f68628b98f09..2ae4dc706100de1d153fbddec28b38640fcf8e6b 100755 (executable)
@@ -5,8 +5,11 @@ set -e
 MODEL_PATH="${1:-"$MODEL_PATH"}"
 MODEL_NAME="${2:-$(basename "$MODEL_PATH")}"
 
+CONVERTED_MODEL_PATH="${1:-"$CONVERTED_MODEL"}"
+CONVERTED_MODEL_NAME="${2:-$(basename "$CONVERTED_MODEL_PATH" ".gguf")}"
+
 if [ -t 0 ]; then
-    CPP_EMBEDDINGS="data/llamacpp-${MODEL_NAME}-embeddings.bin"
+    CPP_EMBEDDINGS="data/llamacpp-${CONVERTED_MODEL_NAME}-embeddings.bin"
 else
     # Process piped JSON data and convert to binary (matching logits.cpp format)
     TEMP_FILE=$(mktemp /tmp/tmp.XXXXXX.binn)