fix(install.sh): not all systems have nproc

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-06-24 18:21:20 +02:00
parent 04b01cd62c
commit 9e6dec0bc4

View File

@ -77,8 +77,11 @@ USE_AIO=${USE_AIO:-false}
API_KEY=${API_KEY:-}
CORE_IMAGES=${CORE_IMAGES:-false}
# nprocs -1
procs=$(nproc)
procs=$((procs-1))
if available nproc; then
procs=$(nproc)
else
procs=1
fi
THREADS=${THREADS:-$procs}
LATEST_VERSION=$(curl -s "https://api.github.com/repos/mudler/LocalAI/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
VERSION="${VERSION:-$LATEST_VERSION}"