zhengr commited on
Commit
bb51526
·
verified ·
1 Parent(s): 610879e

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +50 -0
entrypoint.sh ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ cd /build
5
+
6
+ # If we have set EXTRA_BACKENDS, then we need to prepare the backends
7
+ if [ -n "$EXTRA_BACKENDS" ]; then
8
+ echo "EXTRA_BACKENDS: $EXTRA_BACKENDS"
9
+ # Space separated list of backends
10
+ for backend in $EXTRA_BACKENDS; do
11
+ echo "Preparing backend: $backend"
12
+ make -C $backend
13
+ done
14
+ fi
15
+
16
+ if [ "$REBUILD" != "false" ]; then
17
+ rm -rf ./local-ai
18
+ make build -j${BUILD_PARALLELISM:-1}
19
+ else
20
+ echo "@@@@@"
21
+ echo "Skipping rebuild"
22
+ echo "@@@@@"
23
+ echo "If you are experiencing issues with the pre-compiled builds, try setting REBUILD=true"
24
+ echo "If you are still experiencing issues with the build, try setting CMAKE_ARGS and disable the instructions set as needed:"
25
+ echo 'CMAKE_ARGS="-DGGML_F16C=OFF -DGGML_AVX512=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF"'
26
+ echo "see the documentation at: https://localai.io/basics/build/index.html"
27
+ echo "Note: See also https://github.com/go-skynet/LocalAI/issues/288"
28
+ echo "@@@@@"
29
+ echo "CPU info:"
30
+ grep -e "model\sname" /proc/cpuinfo | head -1
31
+ grep -e "flags" /proc/cpuinfo | head -1
32
+ if grep -q -e "\savx\s" /proc/cpuinfo ; then
33
+ echo "CPU: AVX found OK"
34
+ else
35
+ echo "CPU: no AVX found"
36
+ fi
37
+ if grep -q -e "\savx2\s" /proc/cpuinfo ; then
38
+ echo "CPU: AVX2 found OK"
39
+ else
40
+ echo "CPU: no AVX2 found"
41
+ fi
42
+ if grep -q -e "\savx512" /proc/cpuinfo ; then
43
+ echo "CPU: AVX512 found OK"
44
+ else
45
+ echo "CPU: no AVX512 found"
46
+ fi
47
+ echo "@@@@@"
48
+ fi
49
+
50
+ exec ./local-ai "$@"