mirror of
https://github.com/mudler/LocalAI
synced 2026-05-24 09:28:23 +00:00
feat(faster-whisper): wire version into bump-deps workflow
Assisted-by: opencode:gpt-5.5 Signed-off-by: Andreas Egli <github@kharan.ch>
This commit is contained in:
parent
989ffe3e55
commit
b5f3a2aabf
3 changed files with 88 additions and 2 deletions
49
.github/bump_ctranslate2_rocm_wheel.sh
vendored
Executable file
49
.github/bump_ctranslate2_rocm_wheel.sh
vendored
Executable file
|
|
@ -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 <repo> <install-script> <var-name>" >&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"
|
||||
33
.github/workflows/bump_deps.yaml
vendored
33
.github/workflows/bump_deps.yaml
vendored
|
|
@ -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<<EOF'
|
||||
cat "CTRANSLATE2_VERSION_message.txt"
|
||||
echo EOF
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
{
|
||||
echo 'commit<<EOF'
|
||||
cat "CTRANSLATE2_VERSION_commit.txt"
|
||||
echo EOF
|
||||
} >> "$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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue