|
#!/bin/bash |
|
|
|
|
|
echo "Checking if current directory contains llama.cpp folder" |
|
if [ -d "llama.cpp" ]; then |
|
if [ -d "llama.cpp/build" ]; then |
|
echo "Changing directory to llama.cpp/build/" |
|
cd llama.cpp/build |
|
|
|
echo "Starting llama-server in the background..." |
|
|
|
|
|
nohup ./bin/llama-server \ |
|
-m ../models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \ |
|
-n 256 -c 1024 -t 2 -b 1 \ |
|
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \ |
|
--port 8081 --mlock --numa numactl & |
|
disown |
|
echo "llama-server launched. Waiting for the server to initialize..." |
|
|
|
sleep 5 |
|
echo "Initialization complete. Proceeding with Streamlit app startup..." |
|
else |
|
echo "Directory 'build' not found inside 'llama.cpp'" |
|
fi |
|
|
|
|
|
elif [ "$(basename "$PWD")" = "llama.cpp" ]; then |
|
echo "First condition is not met, checking if current directory is llama.cpp" |
|
echo "Current directory is llama.cpp" |
|
if [ -d "build" ]; then |
|
echo "Changing directory to build/" |
|
cd build |
|
|
|
echo "Starting llama-server in the background..." |
|
|
|
|
|
nohup ./bin/llama-server \ |
|
-m ../models/sarvam_entity_normalisation_llama_3.1_8b_unsloth.Q4_K_M.gguf \ |
|
-n 256 -c 1024 -t 2 -b 1 \ |
|
--temp 0.1 --repeat-penalty 1.1 --top-k 20 \ |
|
--port 8081 --mlock --numa numactl & |
|
disown |
|
echo "llama-server launched. Waiting for the server to initialize..." |
|
|
|
sleep 5 |
|
echo "Initialization complete. Proceeding with Streamlit app startup..." |
|
else |
|
echo "Directory 'build' not found in the current 'llama.cpp' folder" |
|
fi |
|
|
|
|
|
else |
|
echo "'llama.cpp' was not found in the current folder, and the current directory is not 'llama.cpp'." |
|
echo "Current working directory: $(pwd)" |
|
fi |