#!/bin/sh set -eu [ "$#" -eq 1 ] || { echo "usage: $0 GEM_LONG_PREFIX_AB" >&2; exit 2; } binary=$1 set +e GEM_LONG_PREFIX_CANDIDATE=bk128 "$binary" /nonexistent/gemma.gguf 4096 3 \ >/dev/null 2>&1 bk128_status=$? GEM_LONG_PREFIX_CANDIDATE=invalid "$binary" /nonexistent/gemma.gguf 4096 3 \ >/dev/null 2>&1 invalid_status=$? set -e # An accepted diagnostic mode reaches model opening (status 1); an invalid mode is usage (status 2). [ "$bk128_status" -eq 1 ] || { echo "bk128 diagnostic candidate was not accepted" >&2 exit 1 } [ "$invalid_status" -eq 2 ] || { echo "invalid diagnostic candidate was not rejected" >&2 exit 1 }