From 16cb64c5027ffe944ad91879f00e51403337ce7f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 23 Oct 2023 22:34:43 +0100 Subject: [PATCH] build: use venv <= virtualenv --- .github/workflows/ci.yml | 4 +--- cht-llama-cpp/README.md | 1 - cht-llama-cpp/build-aarch64-apple-darwin.sh | 10 ++++++---- 3 files changed, 7 insertions(+), 8 deletions(-) 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 b682d33..026d0c0 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 dee77c1..80b2495 100755 --- a/cht-llama-cpp/build-aarch64-apple-darwin.sh +++ b/cht-llama-cpp/build-aarch64-apple-darwin.sh @@ -1,9 +1,10 @@ #!/bin/bash set -e -export VERSION=1.0.0 +export VERSION=1.0.1 + +test -f venv/bin/activate || python -m venv venv +source venv/bin/activate -virtualenv venv -p=${1:-3.11} -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 +13,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