Skip to content

Commit bcf5978

Browse files
authored
Merge pull request #12 from audiohacking/copilot/add-custom-repo-option
feat: support custom repo/branch for acestep-cpp via env vars
2 parents 39ead10 + cb2052e commit bcf5978

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ MODELS_DIR=./models
3131
#
3232
# ACESTEP_API_URL=http://localhost:7860
3333

34+
# ── acestep-cpp source / custom fork ─────────────────────────────────────────
35+
# Override the repository cloned by build.sh (useful for custom forks):
36+
# ACESTEP_CPP_REPO=https://github.com/your-fork/acestep.cpp.git
37+
#
38+
# Checkout a specific branch or tag after cloning:
39+
# ACESTEP_CPP_BRANCH=main
40+
3441
# ── Storage ───────────────────────────────────────────────────────────────────
3542
AUDIO_DIR=./public/audio
3643

build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# --rocm force ROCm/HIP build
1111
# --vulkan force Vulkan build
1212
# --cpu CPU-only build (disable GPU auto-detection)
13-
# --repo URL override the git repository to clone
13+
# --repo URL override the git repository to clone (env: ACESTEP_CPP_REPO)
14+
# --branch NAME checkout a specific branch/tag after cloning (env: ACESTEP_CPP_BRANCH)
1415

1516
set -e
1617

@@ -19,6 +20,7 @@ SRC_DIR="${ACESTEP_CPP_SRC:-$DIR/acestep.cpp}"
1920
BIN_DIR="${ACESTEP_BIN_DIR:-$DIR/bin}"
2021
BUILD_DIR="$SRC_DIR/build"
2122
REPO="${ACESTEP_CPP_REPO:-https://github.com/audiohacking/acestep.cpp.git}"
23+
BRANCH="${ACESTEP_CPP_BRANCH:-}"
2224
FORCE_FLAGS=""
2325
CPU_ONLY=0
2426

@@ -28,6 +30,7 @@ while [ $# -gt 0 ]; do
2830
--src) SRC_DIR="$2"; BUILD_DIR="$SRC_DIR/build"; shift ;;
2931
--bin) BIN_DIR="$2"; shift ;;
3032
--repo) REPO="$2"; shift ;;
33+
--branch) BRANCH="$2"; shift ;;
3134
--cuda) FORCE_FLAGS="-DGGML_CUDA=ON" ;;
3235
--rocm) FORCE_FLAGS="-DGGML_HIP=ON" ;;
3336
--vulkan) FORCE_FLAGS="-DGGML_VULKAN=ON" ;;
@@ -60,8 +63,13 @@ fi
6063

6164
# ── Clone or update acestep.cpp ───────────────────────────────────────────────
6265
if [ ! -d "$SRC_DIR/.git" ]; then
63-
echo "Cloning acestep.cpp from $REPO ..."
64-
git clone --depth 1 "$REPO" "$SRC_DIR"
66+
if [ -n "$BRANCH" ]; then
67+
echo "Cloning acestep.cpp from $REPO (branch: $BRANCH) ..."
68+
git clone --depth 1 --branch "$BRANCH" "$REPO" "$SRC_DIR"
69+
else
70+
echo "Cloning acestep.cpp from $REPO ..."
71+
git clone --depth 1 "$REPO" "$SRC_DIR"
72+
fi
6573
echo ""
6674
else
6775
echo "acestep.cpp source found at $SRC_DIR"

setup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ elif [ -n "${ACESTEP_BIN:-}" ] && [ -x "$ACESTEP_BIN" ]; then
3737
else
3838
echo ""
3939
echo "Building acestep.cpp for your hardware (detects GPU automatically)..."
40+
echo " Repo: ${ACESTEP_CPP_REPO:-https://github.com/audiohacking/acestep.cpp.git}"
41+
[ -n "${ACESTEP_CPP_BRANCH:-}" ] && echo " Branch: $ACESTEP_CPP_BRANCH"
4042
echo ""
4143
bash build.sh || {
4244
echo ""
@@ -46,6 +48,10 @@ else
4648
echo " cmake --build acestep.cpp/build --parallel"
4749
echo " Then set ACESTEP_BIN_DIR=$(pwd)/bin in .env"
4850
echo ""
51+
echo " To use a custom fork or branch, set before running setup.sh:"
52+
echo " ACESTEP_CPP_REPO=https://github.com/your-fork/acestep.cpp.git ./setup.sh"
53+
echo " ACESTEP_CPP_BRANCH=my-branch ./setup.sh"
54+
echo ""
4955
}
5056
fi
5157

0 commit comments

Comments
 (0)