Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

cht-llama-cpp/build-darwin: use venv <= virtualenv #121

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ jobs:
with: {python-version: 3.11}
- id: dist
name: build
run: |
pip install virtualenv
./build-aarch64-apple-darwin.sh $(python -c 'import sys; print(".".join(map(str,sys.version_info[:2])))')
run: ./build-aarch64-apple-darwin.sh
working-directory: ${{ matrix.model }}
- uses: actions/upload-artifact@v3
with:
Expand Down
1 change: 0 additions & 1 deletion cht-llama-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ wget -P ./ml/models/ https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-GGUF/re
## Compile the Backend

```bash
pip install virtualenv
./build-aarch64-apple-darwin.sh
```

Expand Down
12 changes: 8 additions & 4 deletions cht-llama-cpp/build-aarch64-apple-darwin.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/bash
set -e
export VERSION=1.1.0

virtualenv venv -p=${1:-3.11}
source ./venv/bin/activate
export VERSION=1.1.1

test -f venv/bin/activate || python -m venv venv
source venv/bin/activate


pip install -r requirements.txt pyinstaller
LLAMA_CPP_PATH=$(python -c 'import llama_cpp; print(llama_cpp.__path__[0])')
# macOS (dylib) package
Expand All @@ -12,6 +15,7 @@ pyinstaller --onefile \
--target-arch arm64 \
--add-binary "$LLAMA_CPP_PATH/libllama.dylib:llama_cpp" \
--name=$NAME \
--paths ./venv/lib/python${1:-3.11}/site-packages \
main.py
cp dist/$NAME dist/cht-llama-cpp-mistral-${VERSION%%.*}-aarch64-apple-darwin

deactivate