| _S="${BASH_SOURCE[0]:-$0}"; ROOT="${ROOT:-$(cd "$(dirname "$_S")" && pwd)}"; ROOT="${ROOT%%/results/*}"; ROOT="${ROOT%%/Benchmark_eval/*}"; ROOT="${ROOT%%/Benchmarks/*}" # RELOC_ROOT_MARK | |
| # Rebuild the OOS test set (only the datasets we actually use) byte-identical from raw, seed=42. | |
| # Produces 5 files: | |
| # threesplit_501ts_promptV2.jsonl metric-QA zh md5 154306d835bb... | |
| # caption_501ts_3split.jsonl caption zh md5 820fe34d2997... | |
| # caption_3split_501ts_para1.jsonl caption zh para#1 md5 11dce0be3dd3... | |
| # caption_3split_501ts_para2.jsonl caption zh para#2 md5 ced4dfcf28b7... | |
| # caption_3split_501ts_en.jsonl caption en mirror md5 b4fa39d517e6... | |
| # build_oos_v2 is patched to emit only the 2 used files (mvonly / NEWv1 variants not generated); | |
| # build_caption_variants is patched to 3split-only. QA-EN (LLM-translated) is NOT built here. | |
| set -euo pipefail | |
| PY=${PY:-/root/miniconda3/bin/python} | |
| DIR=$ROOT/Benchmark_eval/TS_Caption_test | |
| B=$DIR/_build | |
| SRC=${SRC:-$ROOT/Benchmarks/TS_Caption_test} | |
| [ -d "$SRC/multivar" ] || { echo "raw TS_Caption_test missing: $SRC"; exit 1; } | |
| rm -f "$DIR"/*.jsonl # clean slate — only the used files below get regenerated | |
| echo "[1/2] build_oos_v2 (seed=42) -> threesplit_501ts_promptV2 + caption_501ts_3split" | |
| cd "$B" | |
| PYTHONPATH="$B" "$PY" build_oos_v2.py --ts-test-root "$SRC" --src-root "$B" --out-dir "$DIR" --seed 42 2>/dev/null | |
| echo "[2/2] build_caption_variants -> caption_3split_501ts_{para1,para2,en}" | |
| "$PY" build_caption_variants.py --src-3split "$DIR/caption_501ts_3split.jsonl" --out-dir "$DIR" --variants para1,para2,en | |
| # [OPTIONAL — disabled by default] QA-English via LLM translation (GLM/Anthropic). | |
| # Verified working (build_en_qa.py present in _build/, smoke-tested --limit 2 = OK). | |
| # ⚠ NON-deterministic: a fresh LLM translation each run; the output will NOT byte-match | |
| # the canonical threesplit_..._promptV2_EN (761f965c). | |
| # Set the GLM creds via env (export), then uncomment to run: | |
| # export ANTHROPIC_AUTH_TOKEN=<your-glm-token> | |
| # export ANTHROPIC_BASE_URL=<glm-anthropic-base-url> | |
| # export EXTRACTOR_MODEL=glm-5.1 | |
| # echo "[opt] build_en_qa (LLM translation — non-reproducible)" | |
| # PYTHONPATH="$B" "$PY" "$B/build_en_qa.py" \ | |
| # --src "$DIR/threesplit_501ts_promptV2.jsonl" --out "$DIR/threesplit_501ts_promptV2_EN.jsonl" | |
| echo "=== md5 check vs canonical ===" | |
| chk() { printf " %-34s %s (canonical %s)\n" "$1" "$(md5sum "$DIR/$1" | cut -d' ' -f1)" "$2"; } | |
| chk threesplit_501ts_promptV2.jsonl 154306d835bb... | |
| chk caption_501ts_3split.jsonl 820fe34d2997... | |
| chk caption_3split_501ts_para1.jsonl 11dce0be3dd3... | |
| chk caption_3split_501ts_para2.jsonl ced4dfcf28b7... | |
| chk caption_3split_501ts_en.jsonl b4fa39d517e6... | |
| echo "DONE -> $DIR ($(ls "$DIR"/*.jsonl | wc -l) files)" | |