diff --git a/.env.example b/.env.example index 7aebdae..e76874a 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,13 @@ MODELS_DIR=./models # # ACESTEP_API_URL=http://localhost:7860 +# ── acestep-cpp source / custom fork ───────────────────────────────────────── +# Override the repository cloned by build.sh (useful for custom forks): +# ACESTEP_CPP_REPO=https://github.com/your-fork/acestep.cpp.git +# +# Checkout a specific branch or tag after cloning: +# ACESTEP_CPP_BRANCH=main + # ── Storage ─────────────────────────────────────────────────────────────────── AUDIO_DIR=./public/audio diff --git a/build.sh b/build.sh index 26103d0..6edd2b2 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,8 @@ # --rocm force ROCm/HIP build # --vulkan force Vulkan build # --cpu CPU-only build (disable GPU auto-detection) -# --repo URL override the git repository to clone +# --repo URL override the git repository to clone (env: ACESTEP_CPP_REPO) +# --branch NAME checkout a specific branch/tag after cloning (env: ACESTEP_CPP_BRANCH) set -e @@ -19,6 +20,7 @@ SRC_DIR="${ACESTEP_CPP_SRC:-$DIR/acestep.cpp}" BIN_DIR="${ACESTEP_BIN_DIR:-$DIR/bin}" BUILD_DIR="$SRC_DIR/build" REPO="${ACESTEP_CPP_REPO:-https://github.com/audiohacking/acestep.cpp.git}" +BRANCH="${ACESTEP_CPP_BRANCH:-}" FORCE_FLAGS="" CPU_ONLY=0 @@ -28,6 +30,7 @@ while [ $# -gt 0 ]; do --src) SRC_DIR="$2"; BUILD_DIR="$SRC_DIR/build"; shift ;; --bin) BIN_DIR="$2"; shift ;; --repo) REPO="$2"; shift ;; + --branch) BRANCH="$2"; shift ;; --cuda) FORCE_FLAGS="-DGGML_CUDA=ON" ;; --rocm) FORCE_FLAGS="-DGGML_HIP=ON" ;; --vulkan) FORCE_FLAGS="-DGGML_VULKAN=ON" ;; @@ -60,8 +63,13 @@ fi # ── Clone or update acestep.cpp ─────────────────────────────────────────────── if [ ! -d "$SRC_DIR/.git" ]; then - echo "Cloning acestep.cpp from $REPO ..." - git clone --depth 1 "$REPO" "$SRC_DIR" + if [ -n "$BRANCH" ]; then + echo "Cloning acestep.cpp from $REPO (branch: $BRANCH) ..." + git clone --depth 1 --branch "$BRANCH" "$REPO" "$SRC_DIR" + else + echo "Cloning acestep.cpp from $REPO ..." + git clone --depth 1 "$REPO" "$SRC_DIR" + fi echo "" else echo "acestep.cpp source found at $SRC_DIR" diff --git a/setup.sh b/setup.sh index 6f3f10a..7ee1af5 100755 --- a/setup.sh +++ b/setup.sh @@ -37,6 +37,8 @@ elif [ -n "${ACESTEP_BIN:-}" ] && [ -x "$ACESTEP_BIN" ]; then else echo "" echo "Building acestep.cpp for your hardware (detects GPU automatically)..." + echo " Repo: ${ACESTEP_CPP_REPO:-https://github.com/audiohacking/acestep.cpp.git}" + [ -n "${ACESTEP_CPP_BRANCH:-}" ] && echo " Branch: $ACESTEP_CPP_BRANCH" echo "" bash build.sh || { echo "" @@ -46,6 +48,10 @@ else echo " cmake --build acestep.cpp/build --parallel" echo " Then set ACESTEP_BIN_DIR=$(pwd)/bin in .env" echo "" + echo " To use a custom fork or branch, set before running setup.sh:" + echo " ACESTEP_CPP_REPO=https://github.com/your-fork/acestep.cpp.git ./setup.sh" + echo " ACESTEP_CPP_BRANCH=my-branch ./setup.sh" + echo "" } fi