2
0

gguf 692 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. src_dir="./third_party/source/llama.cpp"
  5. clean() {
  6. echo "ggml clean"
  7. rm -rf "${src_dir}"
  8. }
  9. sync() {
  10. echo "ggml sync"
  11. if [ ! -d "${src_dir}" ]; then
  12. git clone --quiet --depth=1 --branch master --single-branch https://github.com/ggerganov/llama.cpp.git "${src_dir}"
  13. else
  14. git -C "${src_dir}" fetch --quiet --depth=1 origin master
  15. git -C "${src_dir}" reset --quiet --hard FETCH_HEAD
  16. git -C "${src_dir}" gc --quiet --prune=all
  17. fi
  18. }
  19. while [ "$#" != 0 ]; do
  20. command="$1" && shift
  21. case "${command}" in
  22. "clean") clean;;
  23. "sync") sync;;
  24. esac
  25. done