mirror of
https://github.com/ggerganov/llama.cpp
synced 2026-03-06 23:30:06 +01:00
This commit modifies all the utility scripts to use an optional
BUILD_DIR variable/argument to specify the build directory.
The motivation for this is that Commit
3d55846a5c ("model-conversion : add
BUILD_DIR variable to run-converted-model scripts") introduced this
variable to the causal and embeddings scripts, but I missed the scripts
in the utils directory.
28 lines
646 B
Bash
Executable File
28 lines
646 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
#
|
|
# First try command line argument, then environment variable, then file
|
|
CONVERTED_MODEL="${1:-"$CONVERTED_MODEL"}"
|
|
BUILD_DIR="${2:-"$BUILD_DIR"}"
|
|
|
|
# Final check if we have a model path
|
|
if [ -z "$CONVERTED_MODEL" ]; then
|
|
echo "Error: Model path must be provided either as:" >&2
|
|
echo " 1. Command line argument" >&2
|
|
echo " 2. CONVERTED_MODEL environment variable" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$BUILD_DIR" ]; then
|
|
BUILD_DIR="../../build"
|
|
fi
|
|
|
|
echo $CONVERTED_MODEL
|
|
|
|
cmake --build $BUILD_DIR --target llama-server
|
|
|
|
${BUILD_DIR}/bin/llama-server -m $CONVERTED_MODEL \
|
|
--embedding \
|
|
--pooling none
|