talk-llama : sync llama.cpp

This commit is contained in:
Georgi Gerganov
2026-08-25 15:28:56 +03:00
parent 3680f66fa4
commit 978113305b
2 changed files with 19 additions and 10 deletions
+17 -8
View File
@@ -1,11 +1,20 @@
#!/bin/bash
# note: run from the whisper.cpp root directory
set -euo pipefail
cp -rpv ../llama.cpp/include/llama.h ./examples/talk-llama/llama.h
# read the current llama.cpp version from the neighboring repo
LLAMA_VERSION=$(sed -nE 's/^set\(LLAMA_VERSION_(MAJOR|MINOR|PATCH) ([0-9]+)\)$/\2/p' ../llama.cpp/CMakeLists.txt | paste -sd. -)
cp -rpv ../llama.cpp/src/llama*.cpp ./examples/talk-llama/
cp -rpv ../llama.cpp/src/llama*.h ./examples/talk-llama/
cp -rpv ../llama.cpp/src/models/* ./examples/talk-llama/models/
cp -rpv ../llama.cpp/src/unicode.h ./examples/talk-llama/unicode.h
cp -rpv ../llama.cpp/src/unicode.cpp ./examples/talk-llama/unicode.cpp
cp -rpv ../llama.cpp/src/unicode-data.h ./examples/talk-llama/unicode-data.h
cp -rpv ../llama.cpp/src/unicode-data.cpp ./examples/talk-llama/unicode-data.cpp
if [ -z "${LLAMA_VERSION}" ]; then
echo "error: could not read llama.cpp version from ../llama.cpp/CMakeLists.txt" >&2
exit 1
fi
# update the version number in examples/talk-llama/CMakeLists.txt
sed -i.bak \
-E -e "s/(find_package[(]llama )[0-9]+\.[0-9]+\.[0-9]+/\1${LLAMA_VERSION}/" \
-e "s/(set[(]LLAMA_TAG \"v)[0-9]+\.[0-9]+\.[0-9]+/\1${LLAMA_VERSION}/" \
examples/talk-llama/CMakeLists.txt
rm examples/talk-llama/CMakeLists.txt.bak
echo "synced llama.cpp version: ${LLAMA_VERSION}"