2023-03-25 00:53:39 +03:00
|
|
|
|
distributable:
|
2023-10-26 14:24:04 +03:00
|
|
|
|
url: https://github.com/ggerganov/llama.cpp/archive/refs/tags/b{{version.raw}}.tar.gz
|
2023-03-25 00:53:39 +03:00
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
|
|
versions:
|
2023-10-26 14:24:04 +03:00
|
|
|
|
github: ggerganov/llama.cpp/tags
|
|
|
|
|
strip: /^b/
|
2023-03-25 00:53:39 +03:00
|
|
|
|
|
2023-12-27 18:12:17 +03:00
|
|
|
|
display-name: LLaMA.cpp
|
2023-07-30 15:00:35 +03:00
|
|
|
|
|
2023-03-25 00:53:39 +03:00
|
|
|
|
provides:
|
|
|
|
|
- bin/llama.cpp
|
2023-07-24 23:43:32 +03:00
|
|
|
|
# NOTE! we do not “provide” convert.py. ∵ it’s too generic
|
|
|
|
|
# do `tea +github.com∕ggerganov∕llama.cpp convert.py`
|
|
|
|
|
|
|
|
|
|
platforms:
|
|
|
|
|
- linux
|
|
|
|
|
- darwin/aarch64
|
|
|
|
|
# Illegal instruction: 4 on darwin/x86-64
|
|
|
|
|
|
|
|
|
|
dependencies:
|
2023-10-26 14:24:04 +03:00
|
|
|
|
pkgx.sh: ^1
|
2024-06-03 23:05:35 +03:00
|
|
|
|
linux:
|
|
|
|
|
gnu.org/gcc: '*' # clang doesn't provide omp.h, and we need libstdc++
|
2023-03-25 00:53:39 +03:00
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
dependencies:
|
2023-07-24 23:43:32 +03:00
|
|
|
|
gnu.org/coreutils: '*'
|
2023-11-02 06:00:18 +03:00
|
|
|
|
git-scm.org: '*'
|
2023-12-27 18:12:17 +03:00
|
|
|
|
curl.se: '*'
|
2024-01-04 20:55:53 +03:00
|
|
|
|
python.org: ~3.11
|
2023-07-24 23:43:32 +03:00
|
|
|
|
env:
|
|
|
|
|
VIRTUAL_ENV: ${{prefix}}/venv
|
|
|
|
|
script:
|
2023-11-02 06:00:18 +03:00
|
|
|
|
# segfaults on some GHA runners
|
2024-06-03 23:05:35 +03:00
|
|
|
|
- run: sed -i -e's/\(MK_.* -march=native -mtune=native\)/#\1/g' Makefile
|
2023-11-02 06:00:18 +03:00
|
|
|
|
if: linux/x86-64
|
2023-12-27 18:12:17 +03:00
|
|
|
|
|
2024-01-02 18:14:18 +03:00
|
|
|
|
# this commit breaks linux/aarch64 - fixed in 1732
|
2023-12-27 18:12:17 +03:00
|
|
|
|
- run: curl -LSs 'https://github.com/ggerganov/llama.cpp/pull/4630/commits/42f5246effafddcf87d67656b58e95030f4bc454.patch' | patch -p1 -R
|
2024-01-02 18:14:18 +03:00
|
|
|
|
if: '>=1705<1732'
|
2023-12-27 18:12:17 +03:00
|
|
|
|
|
2023-10-26 14:24:04 +03:00
|
|
|
|
- make --jobs {{hw.concurrency}}
|
|
|
|
|
|
2023-07-24 23:43:32 +03:00
|
|
|
|
- |
|
2024-06-13 18:52:44 +03:00
|
|
|
|
if test -f main; then
|
|
|
|
|
install -D main {{prefix}}/bin/llama.cpp
|
|
|
|
|
elif test -f llama-cli; then
|
|
|
|
|
install -D llama-cli {{prefix}}/bin/llama.cpp
|
|
|
|
|
else
|
|
|
|
|
echo "No binary found"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2023-10-26 14:24:04 +03:00
|
|
|
|
install -D props/entrypoint.sh {{prefix}}/entrypoint.sh
|
2024-06-27 01:26:06 +03:00
|
|
|
|
if test -f ggml-metal.metal; then
|
|
|
|
|
install -D ggml-metal.metal {{prefix}}/bin/ggml-metal.metal
|
|
|
|
|
elif test -f ggml/src/ggml-metal.metal; then
|
|
|
|
|
install -D ggml/src/ggml-metal.metal {{prefix}}/bin/ggml-metal.metal
|
|
|
|
|
else
|
|
|
|
|
echo "No ggml-metal.metal found"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2023-07-24 23:43:32 +03:00
|
|
|
|
|
|
|
|
|
- |
|
|
|
|
|
mkdir -p {{prefix}}/share
|
|
|
|
|
mv prompts {{prefix}}/share
|
|
|
|
|
|
2024-05-30 19:08:21 +03:00
|
|
|
|
- |
|
|
|
|
|
if test -f convert.py; then
|
|
|
|
|
install -D convert.py $VIRTUAL_ENV/bin/convert.py
|
|
|
|
|
elif test -f examples/convert-legacy-llama.py; then
|
|
|
|
|
install -D examples/convert-legacy-llama.py $VIRTUAL_ENV/bin/convert.py
|
|
|
|
|
else
|
|
|
|
|
echo "No convert.py found"
|
|
|
|
|
false
|
|
|
|
|
fi
|
2023-07-24 23:43:32 +03:00
|
|
|
|
|
|
|
|
|
- |
|
2024-01-04 20:55:53 +03:00
|
|
|
|
bkpyvenv stage {{prefix}} {{version}}
|
|
|
|
|
$VIRTUAL_ENV/bin/pip install -r requirements.txt
|
|
|
|
|
bkpyvenv seal {{prefix}} convert.py
|
2023-03-25 00:53:39 +03:00
|
|
|
|
|
2023-10-26 14:24:04 +03:00
|
|
|
|
test:
|
2024-03-18 23:19:55 +03:00
|
|
|
|
llama.cpp --version
|
|
|
|
|
# broke in 2453, difficult to filter due to calver tweaks
|
|
|
|
|
# llama.cpp --help
|
2023-10-26 14:24:04 +03:00
|
|
|
|
# ^^ testing more than this requires downloading the models 😬
|
2023-07-24 23:43:32 +03:00
|
|
|
|
|
2023-10-26 14:24:04 +03:00
|
|
|
|
entrypoint: ./entrypoint.sh
|