Reza2kn's picture
Lower Mac streaming batch size after separate paired qualification
52ecfff verified
Raw History Blame Contribute Delete
973 Bytes
#!/bin/sh
# Generated from the declared experimental execution profile; no arbitrary option forwarding.
set -eu
fail() { printf '%s\n' "$1" >&2; exit 64; }
usage() { fail 'run-mlx.sh INPUT.f32le|- en|zh'; }
[ "$(uname -s)" = Darwin ] && [ "$(uname -m)" = arm64 ] || fail 'This launcher requires macos-arm64.'
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
[ "$#" -eq 2 ] || usage
INPUT=$1; LANGUAGE=$2
case "$LANGUAGE" in en|zh) ;; *) usage ;; esac
[ -n "$INPUT" ] || usage
case "$INPUT" in -|/*) ;; *) INPUT="$PWD/$INPUT" ;; esac
cd "$ROOT"
exec python3 -m mlx_runtime --bundle "$ROOT/model" --config "$ROOT/assets/config.json" --frontend "$ROOT/assets/frontend.a8m" --tokenizer "$ROOT/assets/tokenizer.a8tok" --input "$INPUT" --language "$LANGUAGE" --startup realtime18 --delay-ms 240 --dtype float16 --cache-dtype bfloat16 --batch-windows 2 --math-mode compiled --warmup-projections --fuse-projections --memory-limit-gib 4 --silero-vad "$ROOT/assets/silero_vad.onnx"