FlyaiLab's picture
Fix reproduction documentation and single-GPU startup checks
6c4c2ba verified
Raw History Blame Contribute Delete
1.37 kB
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODEL="${1:?usage: bash run_rows.sh MODEL ROWS_JSONL OUTPUT_DIR}"
ROWS="${2:?rows path required}"
OUTPUT="${3:?output directory required}"
# Preserve the caller's interpretation of paths before entering the release.
[[ "$MODEL" = /* ]] || MODEL="$PWD/$MODEL"
[[ "$ROWS" = /* ]] || ROWS="$PWD/$ROWS"
[[ "$OUTPUT" = /* ]] || OUTPUT="$PWD/$OUTPUT"
cd "$ROOT"
export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES-0}"
[[ -d "$MODEL" ]] || { printf 'Model directory not found: %s\n' "$MODEL" >&2; exit 1; }
[[ -f "$ROWS" ]] || { printf 'Rows file not found: %s\n' "$ROWS" >&2; exit 1; }
unset PYTHONHOME PYTHONPATH LD_LIBRARY_PATH
export VLLM_NO_USAGE_STATS=1 TOKENIZERS_PARALLELISM=false OMP_NUM_THREADS=4
if [[ -e "$OUTPUT/results.jsonl" ]]; then
printf 'Use a fresh output directory; results.jsonl already exists.\n' >&2
exit 1
fi
mkdir -p "$OUTPUT"
source ./runtime_env.sh
uv run --frozen --managed-python python selfcheck.py --output "$OUTPUT"
uv run --frozen --managed-python python -m decision_index run \
--engine decision_vllm_engine:DecisionVllmEngine \
--option "model=$MODEL" --option "codebook=$ROOT/choice-codebook.json" \
--option max_model_len=32768 --option max_num_seqs=64 --option "audit_dir=$OUTPUT" \
--rows "$ROWS" --out "$OUTPUT" --edition 0.3 --compact