]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
scripts : make the shell scripts cross-platform (#14341)
authorVedran Miletić <redacted>
Mon, 30 Jun 2025 08:17:18 +0000 (10:17 +0200)
committerGitHub <redacted>
Mon, 30 Jun 2025 08:17:18 +0000 (10:17 +0200)
46 files changed:
.devops/tools.sh
build-xcframework.sh
ci/run.sh
examples/Miku.sh
examples/chat-13B.sh
examples/chat-persistent.sh
examples/chat-vicuna.sh
examples/chat.sh
examples/jeopardy/jeopardy.sh
examples/reason-act.sh
examples/server-llama2-13B.sh
examples/sycl/build.sh
examples/sycl/run-llama2.sh
examples/sycl/run-llama3.sh
examples/ts-type-to-grammar.sh
scripts/apple/validate-apps.sh
scripts/apple/validate-ios.sh
scripts/apple/validate-macos.sh
scripts/apple/validate-tvos.sh
scripts/apple/validate-visionos.sh
scripts/check-requirements.sh
scripts/ci-run.sh
scripts/compare-commits.sh
scripts/debug-test.sh
scripts/gen-authors.sh
scripts/get-hellaswag.sh
scripts/get-pg.sh
scripts/get-wikitext-103.sh
scripts/get-wikitext-2.sh
scripts/get-winogrande.sh
scripts/hf.sh
scripts/qnt-all.sh
scripts/run-all-perf.sh
scripts/run-all-ppl.sh
scripts/sync-ggml-am.sh
scripts/sync-ggml.sh
scripts/tool_bench.sh
tests/test-lora-conversion-inference.sh
tests/test-tokenizer-0.sh
tests/test-tokenizers-repo.sh
tools/gguf-split/tests.sh
tools/mtmd/tests.sh
tools/quantize/tests.sh
tools/server/chat-llama2.sh
tools/server/chat.sh
tools/server/tests/tests.sh

index 41a6b1e55c7d295c9075a24eeaf2b8b0bc8eaa01..8a3a69340059c580777eaea94f0ccc546544a541 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 # Read the first argument into a variable
index a08419a801b4729a9f69ea81f43a6654053cc796..f813984db9dbde6dad54261fb0ff5332f8aeb9bf 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Options
 IOS_MIN_OS_VERSION=16.4
index e1b777c304eaf764f6bcf8d5e082b4dc7f650bb9..1146f86b64e27e70672409e1f7b2f13a65a07b69 100755 (executable)
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # sample usage:
 #
index 0f6c8c8787107e0929b6ad75cacaf2b8d4a78a14..9492bfedc03e74e124aebe78cca96e6578af5379 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 AI_NAME="${AI_NAME:-Miku}"
index 1828903c31670786faa88aaa8e047b5826c2cf4d..f025a47cbfea388dd5341503453d386c3d146310 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
index 9d761ebb843afd46d13c95d4cf1152cff83db76e..d6b6cb95182589089035b96524f3e40b352ab846 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -euo pipefail
 
index ffdd200849503045a3553607aafe4b8eb8770025..c930962fd320342171f5b19fb60a4ad2cafa5d93 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
index 9f85d1e265d007c2aed11f7f58924eb04c696e5c..5fec46d17ba409b49d067945de75a7ddd85eeb05 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 # Temporary script - will be removed in the future
index 07bcb3b8d78ac2077387d11aa73d7487fa757057..800df2c6aee7d59ed3a207c5cb99df54e812e839 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 MODEL=./models/ggml-vicuna-13b-1.1-q4_0.bin
index 06d592799cf1201746b79ac74001fc38da973a6b..3c801920d01958f959d8e55a6d9f1485622ebb21 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 cd `dirname $0`
 cd ..
index 4ce79b7fac4774dbad78d28136c587e737fb924d..fd5a575886f0569b8f9fb416f1f04bab0856ad15 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
index e72b2e2612f0df210fb5cc4a03f30bd09eeaab44..1993520ebdaed49c6ef7f11fa9de29ee56599f78 100755 (executable)
@@ -1,4 +1,4 @@
-
+#!/usr/bin/env bash
 #  MIT license
 #  Copyright (C) 2024 Intel Corporation
 #  SPDX-License-Identifier: MIT
index 40ce8f5b2b7b533527e276c871970f5789f138fc..37195008de70fd3cc6495bc6971dad09f847c909 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #  MIT license
 #  Copyright (C) 2024 Intel Corporation
index 933d1b98bc07575450f90bdb853a6fc6ce249b84..8e21b017f4ca55c56da1811966246c42804cab95 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #  MIT license
 #  Copyright (C) 2025 Intel Corporation
index 9abba2a3daa7d2f5b9ee7c2f27522950f95bb33e..966050407888ef2943573280ed93ebb1f84c0e1a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # ./examples/ts-type-to-grammar.sh "{a:string,b:string,c?:string}"
 # python examples/json_schema_to_grammar.py https://json.schemastore.org/tsconfig.json
index a571aa6fcf5827955af0df507c65588348fcb1b4..f0475758c37ab29baac49ed2771334b183d722e0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 ./scripts/apple/validate-ios.sh
 ./scripts/apple/validate-macos.sh
 ./scripts/apple/validate-visionos.sh
index 7bda1b97299789ff6554571369b49f3137196e64..50800d84a0c1deb2cf008d78b5b1ac8e689bea30 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # validate-ios.sh - Validate iOS Application with embedded llama.xcframework using SwiftUI
 
 # Authentication options (optional) (can be set via environment variables)
index 6dc28e694943b6109ef043b9f0371d805d329b85..fa800ee682027605f3cf21b216bbc0e4aea7290e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # validate-macos.sh - Validate macOS Application with embedded llama.xcframework using SwiftUI
 
 # Authentication options (optional) (can be set via environment variables)
index 6120189e84b28d6c87eab9745965a46c43af1e9c..b4da698749c5867193a39e32fecba75468271baa 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # validate-tvos.sh - Validate tvOS Application with embedded llama.xcframework using SwiftUI
 
 # Authentication options (optional) (can be set via environment variables)
index a18ddcce4a0b27b7b12fec386262ccf99b3985ff..bbdec6602679cbaf419fcc29472cd69fe0f09ae7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # validate-visionos.sh - Validate visionOS Application with embedded llama.xcframework using SwiftUI
 
 # Authentication options (optional) (can be set via environment variables)
index 4c3b05f68b7ba6d49ccfd91e8c6ddb6c932154a9..da2357d76c7a660febb79f1024f14074825f7b7b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -euo pipefail
 
 #
index 06b5d9c6e5949967244f6527e5ba0c2b603281ee..5877a7edab1667dc890fdb86c12d6f41b2da7715 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -euo pipefail
 this=$(realpath "$0"); readonly this
 cd "$(dirname "$this")"
index 94a8eceb302b9d820dca6ae2540c67a976f23acd..051a7a0983fe1e81350a23306814fdc28b8a6911 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ $# -lt 2 ]; then
     echo "usage: ./scripts/compare-commits.sh <commit1> <commit2> [additional llama-bench arguments]"
index c6c1e988a002796261057d19794ecf80eac2f834..7e9e8421b00f7a893d361f6cc6962882fc3bc078 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 PROG=${0##*/}
 build_dir="build-ci-debug"
index 3ef8391cc9c688379e59665c8564982139feb6e2..73e7b386f97f2a77f500146e4b9f47d01836ff00 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 printf "# date: $(date)\n" > AUTHORS
 printf "# this file is auto-generated by scripts/gen-authors.sh\n\n" >> AUTHORS
index 4e1b1cc15f01adaf19846ddf97b4d6ae5761214d..484e56fd8f685bd30c1d4a98cd911f5aad528dce 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wget https://raw.githubusercontent.com/klosax/hellaswag_text_data/main/hellaswag_val_full.txt
 
index b027793e19f7a77aaeb6eff3014add4004cc2f27..f180bf8340241294bf310671338a6c1816b4bf7b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage {
     echo "usage: <n>$0"
index 9c65fafbcc50bfcb74438944e07f0d547245a755..244a371baddc63984e25e12283876ec4faf34e77 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wget https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-103-raw-v1.zip
 
index 5f3845ef59a9e5be153fbdc97f68a94951d80b0c..67b0b0118b41c29a0fb84c20ab91bbfa3413bf56 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wget https://huggingface.co/datasets/ggml-org/ci/resolve/main/wikitext-2-raw-v1.zip
 unzip wikitext-2-raw-v1.zip
index f1fc0e2d47adb6fc192d2ab6d61410ab225a9901..2b48b11756647ac2263d708b8eeb60311478fd9e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wget https://huggingface.co/datasets/ikawrakow/winogrande-eval-for-llama.cpp/raw/main/winogrande-debiased-eval.csv
 
index b251925fa453f9a2f3ee2e250017fd5482d1783c..e41b9053afdf244004acb23f0b1024e8397b6a44 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Shortcut for downloading HF models
 #
index bc43738a2f49831c16290d986942f5ca46103f12..dc04670dff55b13bb90916553789df67e9f90902 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 qnt=(q8_0 q6_k q5_k q5_1 q5_0 q4_k q4_1 q4_0 q3_k q2_k)
 args=""
index 6384e364d558439ad5a7e46ba2f0d7188615c66a..b7de764ff83bff6cbd0b50b8bfd29833d1aefa97 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 qnt=(f16 q8_0 q6_k q5_k q5_1 q5_0 q4_k q4_1 q4_0 q3_k q2_k)
 args="-ngl 999 -n 64 -p 512"
index e15f74f1b666db23a245a0cf3850e8f6929ff0dd..918ecda27913db5d0fe586215733b75ed7b41e83 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 qnt=(f16 q8_0 q6_k q5_k q5_1 q5_0 q4_k q4_1 q4_0 q3_k q2_k)
 args="-ngl 999 -t 8"
index 204354209f2d6dccc039199b00fea7099fc35d9c..73d4eec0b52c4eb8c1ab5feed1359fc970858b35 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Synchronize ggml changes to llama.cpp
 #
index aa1a46b4bfccd59e75b98931410594f1d1bfe87d..6460a77f1c99f8b7969e6975861a56f320d8f1b9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 cp -rpv ../ggml/CMakeLists.txt       ./ggml/CMakeLists.txt
 cp -rpv ../ggml/src/CMakeLists.txt   ./ggml/src/CMakeLists.txt
index 6c7616a88fe5bcd353c6636faa877fcad0744186..05b41d2f1fafb97eb53a096df894a476f743eaef 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -euo pipefail
 
 cmake --build build -j
index 1d1f4886caaa500dfd3d358587dda68be8c97b2c..0255494b824664a1d5a9f11cee59a012bad80925 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 # Array of models to iterate over
index 4d2b8365547df4aefa4274d94fc90fbe375bbccb..7ef009dc903271e09d5e58260587f4cae0c72d14 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Usage:
 #
index 86e839133ce62741dfc6853a0a380b7dfd62c642..1158aebae0f1aab7ed2b7b34b42a7cb5bf481842 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ $# -lt 2 ]; then
     printf "Usage: $0 <git-repo> <target-folder> [<test-exe>]\n"
index 05a93222711d848c43dfa312b7b7f05eb3e229dc..c9ad85da0f1f3d280c86ff5df470f83aa7069848 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -eu
 
index aa0019893283ecbda1cd387a5e19a5144994f114..b25024c2f10ef3add854362ddf67e2e632f81138 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # make sure we are in the right directory
 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
index 70f7610f9877facd10b3c6d52f2e79a594cf9925..ba96161484232a9947f44814bbdc6f8a496e0da8 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -eu
 
index 1fc79b7e191374b434b645951610a68e55537305..450445f17e3f14e34fae3d912b65d000e4a32aa6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 API_URL="${API_URL:-http://127.0.0.1:8080}"
 
index da0a6ca68ca6f008f8185da8f56b8c29d93bcf24..84cea2d56a0d4d0bbc45fbd0f24085a3865ea8cb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 API_URL="${API_URL:-http://127.0.0.1:8080}"
 
index 33fa8cc6464e21fe8f093b3b2f960c270b1039d5..709b5841aa49b1d8ac4fcf2e5b52f0a68564c23a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # make sure we are in the right directory
 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )