Spaces:
Runtime error
Runtime error
File size: 795 Bytes
db9f671 | 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 | #!/bin/sh
# Start nginx
nginx
# Start llamafiler instances
/usr/local/bin/llamafiler --model /base/gemma-2b.gguf --listen 0.0.0.0:8082 &
GEMMA_PID=$!
/usr/local/bin/llamafiler --model /base/embeddings.gguf --listen 0.0.0.0:8081 &
EMBEDDINGS_PID=$!
# Wait for services
until curl -s --fail -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "gemma-2b", "messages":[{"role":"user","content":"hi"}]}' >/dev/null 2>&1 && \
curl -s --fail -X POST http://localhost:8080/v1/embeddings \
-H "Content-Type: application/json" \
-d '{"input":"test"}' >/dev/null 2>&1
do
sleep 1
echo "Waiting for services..."
done
echo 'Services are ready!'
# Start the main application
exec ./bin/entrypoint.sh node app/main.bundle.js
|