Spaces:
Sleeping
Sleeping
File size: 1,435 Bytes
509e097 29c1f03 509e097 b0529f7 29c1f03 509e097 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/bin/bash
# NOK NOK NOK Lancer /entrypoint.sh Original en arrière plan
#echo "*** Starting LocalAI ***"
#/bin/bash /entrypoint.sh &
#ENTRYPOINTBASH_PID=$!
#Integrer Script Original et Lancer LocalAI en Arriere Plan
#https://github.com/mudler/LocalAI/blob/master/entrypoint.sh
set -e
cd /
# 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
echo "*** Starting LocalAI ***" >&2
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 "*** Starting LocalAI In BackGround***" >&2
exec ./local-ai "$@" &
echo "*** Waiting for LocalAI to be ready ***" >&2
for i in {1..15}; do
if (echo >/dev/tcp/127.0.0.1/8080) 2>/dev/null; then
echo "*** LocalAI is ready! Starting Nginx... ***"
break
fi
echo " Waiting... ($i/15)"
sleep 5
done
echo "*** Starting Nginx ***"
nginx -g "daemon off;"
NGINX_PID=$!
|