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

Commit

Permalink
Merge pull request #121 from casperdcl/venv
Browse files Browse the repository at this point in the history
cht-llama-cpp/build-darwin: use venv <= virtualenv
  • Loading branch information
casperdcl authored Oct 25, 2023
2 parents 0448c7f + d832b44 commit e675886
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
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

0 comments on commit e675886

Please sign in to comment.