Akshay Choudhari commited on
Commit
dc13e4f
·
verified ·
1 Parent(s): 20c024c

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +7 -3
start.sh CHANGED
@@ -2,9 +2,13 @@
2
  set -e
3
 
4
  echo "Starting llama.cpp server..."
5
- # Find llama-server binary wherever it is in this image
6
- LLAMA_BIN=$(find / -name "llama-server" -o -name "server" 2>/dev/null | grep -v proc | head -1)
 
 
 
7
  echo "Found llama binary at: $LLAMA_BIN"
 
8
  $LLAMA_BIN \
9
  -m /app/SmolLM2-1.7B-Instruct-Q4_K_M.gguf \
10
  --host 0.0.0.0 \
@@ -15,7 +19,7 @@ $LLAMA_BIN \
15
  --log-disable &
16
 
17
  echo "Waiting for llama.cpp to be ready..."
18
- sleep 10
19
 
20
  echo "Starting Gradio app..."
21
  python3 /app/app.py
 
2
  set -e
3
 
4
  echo "Starting llama.cpp server..."
5
+ # Find llama-server - exclude python/node/venv paths, must be executable file
6
+ LLAMA_BIN=$(find /usr /bin /sbin /opt -type f -name "llama-server" 2>/dev/null | head -1)
7
+ if [ -z "$LLAMA_BIN" ]; then
8
+ LLAMA_BIN=$(find / -type f -name "llama-server" ! -path "*/venv/*" ! -path "*/node/*" ! -path "*/site-packages/*" 2>/dev/null | head -1)
9
+ fi
10
  echo "Found llama binary at: $LLAMA_BIN"
11
+
12
  $LLAMA_BIN \
13
  -m /app/SmolLM2-1.7B-Instruct-Q4_K_M.gguf \
14
  --host 0.0.0.0 \
 
19
  --log-disable &
20
 
21
  echo "Waiting for llama.cpp to be ready..."
22
+ sleep 15
23
 
24
  echo "Starting Gradio app..."
25
  python3 /app/app.py