From 989ffe3e551bb77e61cd965b3262315651e0cb97 Mon Sep 17 00:00:00 2001 From: Andreas Egli Date: Fri, 15 May 2026 14:11:07 +0200 Subject: [PATCH 1/2] fix(faster-whisper): manually install ctranslate2 with rocm support before installing other dependencies Signed-off-by: Andreas Egli --- backend/python/faster-whisper/install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/python/faster-whisper/install.sh b/backend/python/faster-whisper/install.sh index c93dfe0b58b8..0d235b856ffe 100755 --- a/backend/python/faster-whisper/install.sh +++ b/backend/python/faster-whisper/install.sh @@ -26,4 +26,13 @@ if [ "x${BUILD_PROFILE}" == "xl4t12" ]; then USE_PIP=true fi +if [ "x${BUILD_PROFILE}" == "xhipblas" ]; then + ensureVenv + mkdir /tmp/ctranslate2-rocm + wget -O /tmp/ctranslate2-rocm/rocm-python-wheels-Linux.zip https://github.com/OpenNMT/CTranslate2/releases/download/v4.7.1/rocm-python-wheels-Linux.zip + unzip /tmp/ctranslate2-rocm/rocm-python-wheels-Linux.zip -d /tmp/ctranslate2-rocm/ + python3 -m ensurepip + python3 -m pip install --no-dependencies --no-index --find-links=/tmp/ctranslate2-rocm/temp-linux/ ctranslate2 +fi + installRequirements From b5f3a2aabf8dbf4b2fac6083ccb1e9fa2b136c03 Mon Sep 17 00:00:00 2001 From: Andreas Egli Date: Tue, 19 May 2026 09:10:07 +0200 Subject: [PATCH 2/2] feat(faster-whisper): wire version into bump-deps workflow Assisted-by: opencode:gpt-5.5 Signed-off-by: Andreas Egli --- .github/bump_ctranslate2_rocm_wheel.sh | 49 ++++++++++++++++++++++++ .github/workflows/bump_deps.yaml | 33 ++++++++++++++++ backend/python/faster-whisper/install.sh | 8 +++- 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100755 .github/bump_ctranslate2_rocm_wheel.sh diff --git a/.github/bump_ctranslate2_rocm_wheel.sh b/.github/bump_ctranslate2_rocm_wheel.sh new file mode 100755 index 000000000000..08109fa3d33f --- /dev/null +++ b/.github/bump_ctranslate2_rocm_wheel.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Bump the CTranslate2 ROCm Python wheel release pin used by faster-whisper. +set -xe + +REPO=$1 # OpenNMT/CTranslate2 +FILE=$2 # backend/python/faster-whisper/install.sh +VAR=$3 # CTRANSLATE2_VERSION (used for output file names so the workflow can read them) + +if [ -z "$FILE" ] || [ -z "$REPO" ] || [ -z "$VAR" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +LATEST_RELEASE=$(curl -sS -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/$REPO/releases/latest") +LATEST_TAG=$(python3 -c "import json,sys; print(json.load(sys.stdin)['tag_name'])" <<< "$LATEST_RELEASE") + +set +e +CURRENT_VERSION=$(grep -m1 "^${VAR}=" "$FILE" | cut -d= -f2 | sed -E 's/^\$\{[^:]+:-([^}]+)\}$/\1/') +CTRANSLATE2_ROCM_WHEEL_OS=$(grep -m1 '^CTRANSLATE2_ROCM_WHEEL_OS=' "$FILE" | cut -d= -f2 | sed -E 's/^\$\{[^:]+:-([^}]+)\}$/\1/') +set -e + +if [ -z "$CURRENT_VERSION" ]; then + echo "Could not find $VAR in $FILE." + exit 0 +fi + +if [ -z "$CTRANSLATE2_ROCM_WHEEL_OS" ]; then + echo "Could not find CTRANSLATE2_ROCM_WHEEL_OS in $FILE." + exit 0 +fi + +ASSET_NAME="rocm-python-wheels-${CTRANSLATE2_ROCM_WHEEL_OS}.zip" +LATEST_RELEASE="$LATEST_RELEASE" python3 - "$ASSET_NAME" <<'PY' +import json +import os +import sys + +asset_name = sys.argv[1] +release = json.loads(os.environ["LATEST_RELEASE"]) +assets = {asset.get("name") for asset in release.get("assets", [])} +if asset_name not in assets: + raise SystemExit(f"Could not find release asset {asset_name!r}") +PY + +sed -i "$FILE" -e "s/^${VAR}=.*/${VAR}=\${${VAR}:-${LATEST_TAG}}/" + +echo "Changes: https://github.com/$REPO/compare/${CURRENT_VERSION}...${LATEST_TAG}" >> "${VAR}_message.txt" +echo "${LATEST_TAG}" >> "${VAR}_commit.txt" diff --git a/.github/workflows/bump_deps.yaml b/.github/workflows/bump_deps.yaml index c8b95fb03636..22c92cfac07e 100644 --- a/.github/workflows/bump_deps.yaml +++ b/.github/workflows/bump_deps.yaml @@ -88,6 +88,39 @@ jobs: body: ${{ steps.bump.outputs.message }} signoff: true + bump-ctranslate2-rocm-wheel: + # CTranslate2's ROCm wheels are published as release assets, so the + # faster-whisper hipblas install path pins the release tag used in the URL. + if: github.repository == 'mudler/LocalAI' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Bump CTranslate2 ROCm wheel pin 🔧 + id: bump + run: | + bash .github/bump_ctranslate2_rocm_wheel.sh OpenNMT/CTranslate2 backend/python/faster-whisper/install.sh CTRANSLATE2_VERSION + { + echo 'message<> "$GITHUB_OUTPUT" + { + echo 'commit<> "$GITHUB_OUTPUT" + rm -rfv CTRANSLATE2_VERSION_message.txt CTRANSLATE2_VERSION_commit.txt + - name: Create Pull Request + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ secrets.UPDATE_BOT_TOKEN }} + push-to-fork: ci-forks/LocalAI + commit-message: ':arrow_up: Update OpenNMT/CTranslate2 ROCm wheel' + title: 'chore: :arrow_up: Update OpenNMT/CTranslate2 ROCm wheel to `${{ steps.bump.outputs.commit }}`' + branch: "update/CTRANSLATE2_VERSION" + body: ${{ steps.bump.outputs.message }} + signoff: true + bump-vllm-wheel: # vLLM's cu130 wheel comes from a per-tag index URL (no /latest/ alias), # so the cublas13 requirements file pins both a URL segment and a version diff --git a/backend/python/faster-whisper/install.sh b/backend/python/faster-whisper/install.sh index 0d235b856ffe..d5350f700bda 100755 --- a/backend/python/faster-whisper/install.sh +++ b/backend/python/faster-whisper/install.sh @@ -26,11 +26,15 @@ if [ "x${BUILD_PROFILE}" == "xl4t12" ]; then USE_PIP=true fi +CTRANSLATE2_VERSION=${CTRANSLATE2_VERSION:-v4.7.1} +CTRANSLATE2_ROCM_WHEEL_OS=${CTRANSLATE2_ROCM_WHEEL_OS:-Linux} +CTRANSLATE2_ROCM_WHEEL_ARCHIVE="rocm-python-wheels-${CTRANSLATE2_ROCM_WHEEL_OS}.zip" + if [ "x${BUILD_PROFILE}" == "xhipblas" ]; then ensureVenv mkdir /tmp/ctranslate2-rocm - wget -O /tmp/ctranslate2-rocm/rocm-python-wheels-Linux.zip https://github.com/OpenNMT/CTranslate2/releases/download/v4.7.1/rocm-python-wheels-Linux.zip - unzip /tmp/ctranslate2-rocm/rocm-python-wheels-Linux.zip -d /tmp/ctranslate2-rocm/ + wget -O "/tmp/ctranslate2-rocm/${CTRANSLATE2_ROCM_WHEEL_ARCHIVE}" "https://github.com/OpenNMT/CTranslate2/releases/download/${CTRANSLATE2_VERSION}/${CTRANSLATE2_ROCM_WHEEL_ARCHIVE}" + unzip "/tmp/ctranslate2-rocm/${CTRANSLATE2_ROCM_WHEEL_ARCHIVE}" -d /tmp/ctranslate2-rocm/ python3 -m ensurepip python3 -m pip install --no-dependencies --no-index --find-links=/tmp/ctranslate2-rocm/temp-linux/ ctranslate2 fi