lilo / run_cpu.sh
hzlo0's picture
lilo-100m: fp16 + group-wise int8 CPU release
36a88b2 verified
Raw History Blame Contribute Delete
567 Bytes
#!/usr/bin/env bash
# LILO CPU runner — memory-safe: never touches /tmp (tmpfs), bounded threads.
set -euo pipefail
cd "$(dirname "$0")"
export TMPDIR="$PWD/.tmp" # MUST be disk-backed, not tmpfs
export HF_HOME="${HF_HOME:-$PWD/.hf}"
export OMP_NUM_THREADS="${OMP_NUM_THREADS:-2}"
export MALLOC_ARENA_MAX=1 # keep glibc from reserving RAM per thread
export TOKENIZERS_PARALLELISM=false
mkdir -p "$TMPDIR" "$HF_HOME"
PY="${PYTHON:-python3}"
if [ -x "$PWD/.venv/bin/python" ]; then
PY="$PWD/.venv/bin/python"
fi
exec "$PY" chat_lilo.py "$@"