Download eval/bench_run_all.sh from sraivante/tiny-superfast-agentic-MLM-6.5m-v1: direct link, hf CLI and curl.
- Browser
- Download file 952 Bytes
-
https://huggingface.co/sraivante/tiny-superfast-agentic-MLM-6.5m-v1/resolve/main/eval/bench_run_all.sh
- Command line
-
hf download hf://sraivante/tiny-superfast-agentic-MLM-6.5m-v1/eval/bench_run_all.sh
-
curl -L -o bench_run_all.sh https://huggingface.co/sraivante/tiny-superfast-agentic-MLM-6.5m-v1/resolve/main/eval/bench_run_all.sh
952 Bytes
| # usage: run_all.sh <python> <model> <data> <outdir> <thread options...> | |
| PY=$1; M=$2; D=$3; O=$4; shift 4; best=""; bestms=999999 | |
| for t in "$@"; do | |
| if [ "$t" = default ]; then env -u OPENBLAS_NUM_THREADS -u OMP_NUM_THREADS $PY bench_device.py --model $M --data $D --out $O/probe_$t.json --probe-only --probe-n 300 | |
| else OPENBLAS_NUM_THREADS=$t OMP_NUM_THREADS=$t $PY bench_device.py --model $M --data $D --out $O/probe_$t.json --probe-only --probe-n 300; fi | |
| ms=$($PY -c "import json;print(json.load(open('$O/probe_$t.json'))['mean_ms'])"); echo "probe $t mean $ms" | |
| if $PY -c "import sys;sys.exit(0 if $ms < $bestms else 1)"; then best=$t; bestms=$ms; fi | |
| done | |
| echo "best threads: $best"; sleep 120 | |
| if [ "$best" = default ]; then $PY bench_device.py --model $M --data $D --out $O/main.json --minutes 10 | |
| else OPENBLAS_NUM_THREADS=$best OMP_NUM_THREADS=$best $PY bench_device.py --model $M --data $D --out $O/main.json --minutes 10; fi | |
| echo ALLDONE | |