diff --git a/backend/cpp/llama-cpp/Makefile b/backend/cpp/llama-cpp/Makefile index b8b1b08be..5c6644696 100644 --- a/backend/cpp/llama-cpp/Makefile +++ b/backend/cpp/llama-cpp/Makefile @@ -1,5 +1,5 @@ -LLAMA_VERSION?=78a8ae14be559b45f5f13ddee82c188b683d5d8d +LLAMA_VERSION?=6050b467c07a95c7b87debd4ddac2f8ba8d9b807 LLAMA_REPO?=https://github.com/ggerganov/llama.cpp CMAKE_ARGS?= @@ -169,7 +169,19 @@ llama.cpp: cd llama.cpp && \ git init && \ git remote add origin $(LLAMA_REPO) && \ - git fetch --all --tags && \ + ( \ + attempt=1; \ + until git fetch --all --tags; do \ + if [ "$$attempt" -ge 3 ]; then \ + echo "git fetch failed after $$attempt attempts" >&2; \ + exit 1; \ + fi; \ + delay=$$((attempt * 3)); \ + echo "git fetch attempt $$attempt failed; retrying in $${delay}s" >&2; \ + sleep "$$delay" || exit 1; \ + attempt=$$((attempt + 1)); \ + done \ + ) && \ git checkout -b build $(LLAMA_VERSION) && \ git submodule update --init --recursive --depth 1 --single-branch