Forráskód Böngészése

scripts : make the shell scripts cross-platform (#14341)

Vedran Miletić 6 hónapja
szülő
commit
e9b6350e61
46 módosított fájl, 46 hozzáadás és 46 törlés
  1. 1 1
      .devops/tools.sh
  2. 1 1
      build-xcframework.sh
  3. 1 1
      ci/run.sh
  4. 1 1
      examples/Miku.sh
  5. 1 1
      examples/chat-13B.sh
  6. 1 1
      examples/chat-persistent.sh
  7. 1 1
      examples/chat-vicuna.sh
  8. 1 1
      examples/chat.sh
  9. 1 1
      examples/jeopardy/jeopardy.sh
  10. 1 1
      examples/reason-act.sh
  11. 1 1
      examples/server-llama2-13B.sh
  12. 1 1
      examples/sycl/build.sh
  13. 1 1
      examples/sycl/run-llama2.sh
  14. 1 1
      examples/sycl/run-llama3.sh
  15. 1 1
      examples/ts-type-to-grammar.sh
  16. 1 1
      scripts/apple/validate-apps.sh
  17. 1 1
      scripts/apple/validate-ios.sh
  18. 1 1
      scripts/apple/validate-macos.sh
  19. 1 1
      scripts/apple/validate-tvos.sh
  20. 1 1
      scripts/apple/validate-visionos.sh
  21. 1 1
      scripts/check-requirements.sh
  22. 1 1
      scripts/ci-run.sh
  23. 1 1
      scripts/compare-commits.sh
  24. 1 1
      scripts/debug-test.sh
  25. 1 1
      scripts/gen-authors.sh
  26. 1 1
      scripts/get-hellaswag.sh
  27. 1 1
      scripts/get-pg.sh
  28. 1 1
      scripts/get-wikitext-103.sh
  29. 1 1
      scripts/get-wikitext-2.sh
  30. 1 1
      scripts/get-winogrande.sh
  31. 1 1
      scripts/hf.sh
  32. 1 1
      scripts/qnt-all.sh
  33. 1 1
      scripts/run-all-perf.sh
  34. 1 1
      scripts/run-all-ppl.sh
  35. 1 1
      scripts/sync-ggml-am.sh
  36. 1 1
      scripts/sync-ggml.sh
  37. 1 1
      scripts/tool_bench.sh
  38. 1 1
      tests/test-lora-conversion-inference.sh
  39. 1 1
      tests/test-tokenizer-0.sh
  40. 1 1
      tests/test-tokenizers-repo.sh
  41. 1 1
      tools/gguf-split/tests.sh
  42. 1 1
      tools/mtmd/tests.sh
  43. 1 1
      tools/quantize/tests.sh
  44. 1 1
      tools/server/chat-llama2.sh
  45. 1 1
      tools/server/chat.sh
  46. 1 1
      tools/server/tests/tests.sh

+ 1 - 1
.devops/tools.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 # Read the first argument into a variable

+ 1 - 1
build-xcframework.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Options
 IOS_MIN_OS_VERSION=16.4

+ 1 - 1
ci/run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # sample usage:
 #

+ 1 - 1
examples/Miku.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 AI_NAME="${AI_NAME:-Miku}"

+ 1 - 1
examples/chat-13B.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 

+ 1 - 1
examples/chat-persistent.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -euo pipefail
 

+ 1 - 1
examples/chat-vicuna.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 

+ 1 - 1
examples/chat.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #
 # Temporary script - will be removed in the future

+ 1 - 1
examples/jeopardy/jeopardy.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 MODEL=./models/ggml-vicuna-13b-1.1-q4_0.bin

+ 1 - 1
examples/reason-act.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 cd `dirname $0`
 cd ..

+ 1 - 1
examples/server-llama2-13B.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 

+ 1 - 1
examples/sycl/build.sh

@@ -1,4 +1,4 @@
-
+#!/usr/bin/env bash
 #  MIT license
 #  Copyright (C) 2024 Intel Corporation
 #  SPDX-License-Identifier: MIT

+ 1 - 1
examples/sycl/run-llama2.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #  MIT license
 #  Copyright (C) 2024 Intel Corporation

+ 1 - 1
examples/sycl/run-llama3.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 #  MIT license
 #  Copyright (C) 2025 Intel Corporation

+ 1 - 1
examples/ts-type-to-grammar.sh

@@ -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

+ 1 - 1
scripts/apple/validate-apps.sh

@@ -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

+ 1 - 1
scripts/apple/validate-ios.sh

@@ -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)

+ 1 - 1
scripts/apple/validate-macos.sh

@@ -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)

+ 1 - 1
scripts/apple/validate-tvos.sh

@@ -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)

+ 1 - 1
scripts/apple/validate-visionos.sh

@@ -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)

+ 1 - 1
scripts/check-requirements.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -euo pipefail
 
 #

+ 1 - 1
scripts/ci-run.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -euo pipefail
 this=$(realpath "$0"); readonly this
 cd "$(dirname "$this")"

+ 1 - 1
scripts/compare-commits.sh

@@ -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]"

+ 1 - 1
scripts/debug-test.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 PROG=${0##*/}
 build_dir="build-ci-debug"

+ 1 - 1
scripts/gen-authors.sh

@@ -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

+ 1 - 1
scripts/get-hellaswag.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wget https://raw.githubusercontent.com/klosax/hellaswag_text_data/main/hellaswag_val_full.txt
 

+ 1 - 1
scripts/get-pg.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 function usage {
     echo "usage: <n>$0"

+ 1 - 1
scripts/get-wikitext-103.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wget https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-103-raw-v1.zip
 

+ 1 - 1
scripts/get-wikitext-2.sh

@@ -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

+ 1 - 1
scripts/get-winogrande.sh

@@ -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
 

+ 1 - 1
scripts/hf.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Shortcut for downloading HF models
 #

+ 1 - 1
scripts/qnt-all.sh

@@ -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=""

+ 1 - 1
scripts/run-all-perf.sh

@@ -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"

+ 1 - 1
scripts/run-all-ppl.sh

@@ -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"

+ 1 - 1
scripts/sync-ggml-am.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Synchronize ggml changes to llama.cpp
 #

+ 1 - 1
scripts/sync-ggml.sh

@@ -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

+ 1 - 1
scripts/tool_bench.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -euo pipefail
 
 cmake --build build -j

+ 1 - 1
tests/test-lora-conversion-inference.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 # Array of models to iterate over

+ 1 - 1
tests/test-tokenizer-0.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Usage:
 #

+ 1 - 1
tests/test-tokenizers-repo.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ $# -lt 2 ]; then
     printf "Usage: $0 <git-repo> <target-folder> [<test-exe>]\n"

+ 1 - 1
tools/gguf-split/tests.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -eu
 

+ 1 - 1
tools/mtmd/tests.sh

@@ -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 )

+ 1 - 1
tools/quantize/tests.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -eu
 

+ 1 - 1
tools/server/chat-llama2.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 API_URL="${API_URL:-http://127.0.0.1:8080}"
 

+ 1 - 1
tools/server/chat.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 API_URL="${API_URL:-http://127.0.0.1:8080}"
 

+ 1 - 1
tools/server/tests/tests.sh

@@ -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 )