From 89f179e05e1d2174a2c54753afba6d0306c531ed Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Sat, 5 Sep 2026 05:04:53 +0200 Subject: [PATCH] snapotter: seed AI venv base packages on arm64, warn amd64 has no working CPU bundle (#16903) --- ct/snapotter.sh | 7 +++++++ install/snapotter-install.sh | 19 +++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ct/snapotter.sh b/ct/snapotter.sh index 8d769841f..2b7ccaa2c 100644 --- a/ct/snapotter.sh +++ b/ct/snapotter.sh @@ -88,6 +88,13 @@ EOF msg_info "Updating SnapOtter" $STD uv python install 3.11 $STD uv venv --seed --python 3.11 /opt/snapotter_data/ai/venv + if [[ "$(arch_resolve)" == "arm64" ]]; then + $STD uv pip install --python /opt/snapotter_data/ai/venv/bin/python \ + numpy==1.26.4 Pillow==12.3.0 opencv-python-headless==4.10.0.84 fonttools \ + 'huggingface-hub[hf_xet,hf_transfer]==0.36.2' + else + msg_warn "SnapOtter AI Features have no working CPU-only bundle for amd64 upstream (published bundle is Python 3.12/GPU-CUDA only). Use the official Docker image instead: https://docs.snapotter.com" + fi ln -sfn /opt/snapotter /app msg_ok "Updated SnapOtter" diff --git a/install/snapotter-install.sh b/install/snapotter-install.sh index b8330b7ca..67609fe07 100644 --- a/install/snapotter-install.sh +++ b/install/snapotter-install.sh @@ -34,7 +34,12 @@ $STD apt install -y \ python3 \ python3-dev \ gcc \ - g++ + g++ \ + libavif-bin \ + libavif-dev \ + libopencv-dev \ + python3-opencv \ + libgles2 msg_ok "Installed Dependencies" PYTHON_VERSION="3.11" setup_uv @@ -59,11 +64,13 @@ msg_info "Setting up Python Environment" mkdir -p /opt/snapotter_data/ai/models/rembg $STD uv python install 3.11 $STD uv venv --seed --python 3.11 /opt/snapotter_data/ai/venv -#if [[ -f /opt/snapotter/packages/ai/python/requirements.txt ]]; then -# $STD uv pip install \ -# --python /opt/snapotter_data/ai/venv/bin/python \ -# -r /opt/snapotter/packages/ai/python/requirements.txt -#fi +if [[ "$(arch_resolve)" == "arm64" ]]; then + $STD uv pip install --python /opt/snapotter_data/ai/venv/bin/python \ + numpy==1.26.4 Pillow==12.3.0 opencv-python-headless==4.10.0.84 fonttools \ + 'huggingface-hub[hf_xet,hf_transfer]==0.36.2' +else + msg_warn "SnapOtter AI Features have no working CPU-only bundle for amd64 upstream (published bundle is Python 3.12/GPU-CUDA only). Use the official Docker image instead: https://docs.snapotter.com" +fi ln -sfn /opt/snapotter /app msg_ok "Set up Python Environment"