File: llama.cpp-tools

package info (click to toggle)
llama.cpp 6641%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,824 kB
  • sloc: cpp: 218,020; ansic: 117,624; python: 29,020; lisp: 9,094; sh: 5,776; objc: 1,045; javascript: 828; xml: 259; makefile: 219
file content (36 lines) | stat: -rwxr-xr-x 924 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -u

# We need a special testbed that tells us where to find models we can use
if [ -z "${MODELS_DIR:-}" ]; then
	echo "Environment variable MODELS_DIR not set, skipping tests."
	exit 77
elif ! [ -d "$MODELS_DIR" ]; then
	echo "Not a directory: $MODELS_DIR" >&2
	exit 1
fi

if [ -z "${MODEL_NAMES:-}" ]; then
	MODEL_NAMES="$(grep -Ev '^(#.*|[[:space:]]*)$' debian/tests/supported-models.non-free)"
fi

at_least_one=0
exitcode=
for model_name in $MODEL_NAMES; do
	model_fullpath="$MODELS_DIR/$model_name"
	if ! [ -f "$model_fullpath" ]; then
		echo "Model $model_fullpath not found, skipping"
		continue
	fi
	at_least_one=1

	echo "Running tests using model: $model_fullpath"

	llama-bench -m "$model_fullpath" || exitcode=1

	echo "Finished running tests using model: $model_fullpath"
done

# If not a single test could be run, treat this as an overall skip
[ "$at_least_one" -ge 0 ] ||  exit 77
exit $exitcode