1
0

run_osx.sh 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env bash
  2. trap "kill 0" EXIT
  3. INSTALL_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
  4. ROOT_DIR="${INSTALL_SCRIPT_DIR}/.."
  5. printf "Detecting OS: "
  6. if [ "$(uname)" == "Darwin" ]; then
  7. printf "\e[32mOSX\e[m\n"
  8. else
  9. printf "\e[31m${$(uname)}\e[m\n"
  10. printf "\e[31mERROR:\e[m This script only works on OSX\n"
  11. exit 1
  12. fi
  13. cd ${ROOT_DIR}/working/llama.cpp
  14. ./server -t 4 -c 4096 -ngl 35 -b 512 --mlock -m "./models/openchat_3.5.Q5_K_M.gguf" &
  15. cd ${ROOT_DIR}/working/basic-openai-api-wrapper
  16. source venv/bin/activate
  17. flask run &
  18. cd ${ROOT_DIR}
  19. npm run start &
  20. until $(curl --output /dev/null --silent --head --fail http://localhost:3000); do
  21. printf '.'
  22. sleep 1
  23. done
  24. until $(curl --output /dev/null --silent --head --fail http://localhost:8080); do
  25. printf '.'
  26. sleep 1
  27. done
  28. # until $(curl --output /dev/null --silent --head --fail http://localhost:5000); do
  29. # printf '.'
  30. # sleep 1
  31. # done
  32. open http://localhost:3000
  33. wait