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-03 18:23:56 +03:00
|
|
|
|
python.org: ~3.11
|
2023-10-26 14:24:04 +03:00
|
|
|
|
pkgx.sh: ^1
|
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: '*'
|
2023-07-24 23:43:32 +03:00
|
|
|
|
env:
|
|
|
|
|
VIRTUAL_ENV: ${{prefix}}/venv
|
2023-11-02 06:00:18 +03:00
|
|
|
|
CC: clang
|
|
|
|
|
CXX: clang++
|
|
|
|
|
LD: clang
|
2023-07-24 23:43:32 +03:00
|
|
|
|
script:
|
2023-11-02 06:00:18 +03:00
|
|
|
|
# segfaults on some GHA runners
|
|
|
|
|
- run: |
|
|
|
|
|
sed -i.bak -e's/\(MK_.* -march=native -mtune=native\)/#\1/g' Makefile
|
|
|
|
|
rm Makefile.bak
|
|
|
|
|
if: linux/x86-64
|
2023-12-27 18:12:17 +03:00
|
|
|
|
|
|
|
|
|
# this commit breaks linux/aarch64 - remove once fixed
|
|
|
|
|
- run: curl -LSs 'https://github.com/ggerganov/llama.cpp/pull/4630/commits/42f5246effafddcf87d67656b58e95030f4bc454.patch' | patch -p1 -R
|
|
|
|
|
if: '>=1705'
|
|
|
|
|
|
2023-10-26 14:24:04 +03:00
|
|
|
|
- make --jobs {{hw.concurrency}}
|
|
|
|
|
|
2023-07-24 23:43:32 +03:00
|
|
|
|
- |
|
2023-10-26 14:24:04 +03:00
|
|
|
|
install -D main {{prefix}}/bin/llama.cpp
|
|
|
|
|
install -D props/entrypoint.sh {{prefix}}/entrypoint.sh
|
|
|
|
|
install -D ggml-metal.metal {{prefix}}/bin/ggml-metal.metal
|
2023-07-24 23:43:32 +03:00
|
|
|
|
|
|
|
|
|
- |
|
|
|
|
|
mkdir -p {{prefix}}/share
|
|
|
|
|
mv prompts {{prefix}}/share
|
|
|
|
|
|
|
|
|
|
- |
|
|
|
|
|
install -D convert.py $VIRTUAL_ENV/bin/convert.py
|
|
|
|
|
python-venv-stubber.sh convert.py
|
|
|
|
|
|
|
|
|
|
- |
|
2023-10-26 14:24:04 +03:00
|
|
|
|
python -m venv $VIRTUAL_ENV
|
2023-07-24 23:43:32 +03:00
|
|
|
|
source $VIRTUAL_ENV/bin/activate
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
deactivate
|
2023-03-25 00:53:39 +03:00
|
|
|
|
|
2023-10-26 14:24:04 +03:00
|
|
|
|
test:
|
|
|
|
|
'{{prefix}}/bin/llama.cpp --help'
|
|
|
|
|
# ^^ 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
|