diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bb3c98..3ea2c19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/cht-llama-cpp/README.md b/cht-llama-cpp/README.md index 2471e50..14cf0d4 100644 --- a/cht-llama-cpp/README.md +++ b/cht-llama-cpp/README.md @@ -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 ``` diff --git a/cht-llama-cpp/build-aarch64-apple-darwin.sh b/cht-llama-cpp/build-aarch64-apple-darwin.sh index 7e9abd8..f65fea9 100755 --- a/cht-llama-cpp/build-aarch64-apple-darwin.sh +++ b/cht-llama-cpp/build-aarch64-apple-darwin.sh @@ -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 @@ -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