2023-04-29 18:38:37 +00:00
|
|
|
#!/bin/bash
|
2023-05-30 13:53:37 +00:00
|
|
|
set -e
|
2023-04-29 18:38:37 +00:00
|
|
|
|
|
|
|
cd /build
|
|
|
|
|
2023-12-08 19:04:13 +00:00
|
|
|
# If we have set EXTRA_BACKENDS, then we need to prepare the backends
|
|
|
|
if [ -n "$EXTRA_BACKENDS" ]; then
|
|
|
|
echo "EXTRA_BACKENDS: $EXTRA_BACKENDS"
|
|
|
|
# Space separated list of backends
|
|
|
|
for backend in $EXTRA_BACKENDS; do
|
|
|
|
echo "Preparing backend: $backend"
|
|
|
|
make -C $backend
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2023-05-18 17:18:32 +00:00
|
|
|
if [ "$REBUILD" != "false" ]; then
|
2023-05-30 13:53:37 +00:00
|
|
|
rm -rf ./local-ai
|
2023-11-11 17:40:26 +00:00
|
|
|
make build -j${BUILD_PARALLELISM:-1}
|
2023-07-06 22:29:10 +00:00
|
|
|
else
|
|
|
|
echo "@@@@@"
|
|
|
|
echo "Skipping rebuild"
|
|
|
|
echo "@@@@@"
|
|
|
|
echo "If you are experiencing issues with the pre-compiled builds, try setting REBUILD=true"
|
|
|
|
echo "If you are still experiencing issues with the build, try setting CMAKE_ARGS and disable the instructions set as needed:"
|
2024-06-27 21:10:04 +00:00
|
|
|
echo 'CMAKE_ARGS="-DGGML_F16C=OFF -DGGML_AVX512=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF"'
|
2023-07-06 22:29:10 +00:00
|
|
|
echo "see the documentation at: https://localai.io/basics/build/index.html"
|
|
|
|
echo "Note: See also https://github.com/go-skynet/LocalAI/issues/288"
|
|
|
|
echo "@@@@@"
|
2023-07-23 19:27:55 +00:00
|
|
|
echo "CPU info:"
|
|
|
|
grep -e "model\sname" /proc/cpuinfo | head -1
|
|
|
|
grep -e "flags" /proc/cpuinfo | head -1
|
|
|
|
if grep -q -e "\savx\s" /proc/cpuinfo ; then
|
|
|
|
echo "CPU: AVX found OK"
|
|
|
|
else
|
|
|
|
echo "CPU: no AVX found"
|
|
|
|
fi
|
|
|
|
if grep -q -e "\savx2\s" /proc/cpuinfo ; then
|
|
|
|
echo "CPU: AVX2 found OK"
|
|
|
|
else
|
|
|
|
echo "CPU: no AVX2 found"
|
|
|
|
fi
|
|
|
|
if grep -q -e "\savx512" /proc/cpuinfo ; then
|
|
|
|
echo "CPU: AVX512 found OK"
|
|
|
|
else
|
|
|
|
echo "CPU: no AVX512 found"
|
|
|
|
fi
|
|
|
|
echo "@@@@@"
|
2023-05-18 17:18:32 +00:00
|
|
|
fi
|
2023-04-29 18:38:37 +00:00
|
|
|
|
2024-04-02 07:15:44 +00:00
|
|
|
exec ./local-ai "$@"
|