Skip to content

Commit

Permalink
spleeter-proot: install 2stems model and clean pip cache
Browse files Browse the repository at this point in the history
  • Loading branch information
knyipab committed May 23, 2024
1 parent 7631dba commit a98154c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tur-on-device/spleeter-proot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ termux_step_post_get_source () {
}

termux_step_make_install(){
# install 2stems model
mkdir -p "$PREFIX/etc/spleeter-proot/pretrained_models/2stems"
wget "https://github.com/deezer/spleeter/releases/download/v1.4.0/2stems.tar.gz"
tar -xf 2stems.tar.gz -C "$PREFIX/etc/spleeter-proot/pretrained_models/2stems/"

# install proot rootfs and spleeter
proot-distro install --override-alias app_spleeter ubuntu
proot-distro login app_spleeter --isolated -- eval useradd -U -m -s /bin/bash -p root android
proot-distro login app_spleeter --user android -- eval "
Expand All @@ -36,6 +42,7 @@ rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda run -n spleeter_py310 pip install --no-deps spleeter
~/miniconda3/bin/conda run -n spleeter_py310 pip install ffmpeg-python httpx==0.19.0 norbert typer==0.3.2
~/miniconda3/bin/conda run -n spleeter_py310 pip install pandas==1.5.3 tensorflow==2.10
~/miniconda3/bin/conda run -n spleeter_py310 pip cache purge
"
install -Dm700 "$TERMUX_PKG_BUILDER_DIR"/spleeter-proot $TERMUX_PREFIX/bin/
ln -sfr $TERMUX_PREFIX/bin/spleeter-proot $TERMUX_PREFIX/bin/spleeter
Expand Down
2 changes: 1 addition & 1 deletion tur-on-device/spleeter-proot/spleeter-proot
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/data/data/com.termux/files/usr/bin/sh

proot-distro login --user android app_spleeter --shared-tmp --work-dir "$PWD" -- /home/android/miniconda3/bin/conda run -n spleeter_py310 spleeter "$@"
proot-distro login --user android app_spleeter --shared-tmp --env MODEL_PATH="$PREFIX/etc/spleeter-proot/pretrained_models/2stems" --work-dir "$PWD" -- /home/android/miniconda3/bin/conda run -n spleeter_py310 spleeter "$@"

0 comments on commit a98154c

Please sign in to comment.