Skip to content

Commit

Permalink
Fix installation of aarch64 wheels (#938)
Browse files Browse the repository at this point in the history
* Add support for installing aarch64 wheels

* Fix syntax
  • Loading branch information
gaby authored Dec 4, 2023
1 parent dc6136d commit 1684466
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
16 changes: 12 additions & 4 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
set -x
source serge.env

# Get CPU Architecture
cpu_arch=$(uname -m)

# Function to detect CPU features
detect_cpu_features() {
cpu_info=$(lscpu)
Expand All @@ -17,9 +20,15 @@ detect_cpu_features() {
fi
}

# Detect CPU features and generate install command
cpu_feature=$(detect_cpu_features)
pip_command="python -m pip install -v llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
# Check if the CPU architecture is aarch64/arm64
if [ "$cpu_arch" = "aarch64" ]; then
pip_command="python -m pip install -v llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://gaby.github.io/arm64-wheels/"
else
# Use @jllllll provided wheels
cpu_feature=$(detect_cpu_features)
pip_command="python -m pip install -v llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
fi

echo "Recommended install command for llama-cpp-python: $pip_command"

# Handle termination signals
Expand All @@ -32,7 +41,6 @@ _term() {
# Install python bindings
eval "$pip_command" || {
echo 'Failed to install llama-cpp-python'
python -m pip debug --verbose
exit 1
}

Expand Down
15 changes: 12 additions & 3 deletions scripts/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
set -x
source serge.env

# Get CPU Architecture
cpu_arch=$(uname -m)

# Function to detect CPU features
detect_cpu_features() {
cpu_info=$(lscpu)
Expand All @@ -17,9 +20,15 @@ detect_cpu_features() {
fi
}

# Detect CPU features and generate install command
cpu_feature=$(detect_cpu_features)
pip_command="UNAME_M=$(dpkg --print-architecture) python -m pip install llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
# Check if the CPU architecture is aarch64/arm64
if [ "$cpu_arch" = "aarch64" ]; then
pip_command="python -m pip install -v llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://gaby.github.io/arm64-wheels/"
else
# Use @jllllll provided wheels
cpu_feature=$(detect_cpu_features)
pip_command="python -m pip install -v llama-cpp-python==$LLAMA_PYTHON_VERSION --only-binary=:all: --extra-index-url=https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/$cpu_feature/cpu"
fi

echo "Recommended install command for llama-cpp-python: $pip_command"

# Install python vendor dependencies
Expand Down

0 comments on commit 1684466

Please sign in to comment.