SPB Git

Repository Public Research preview

pilot_rewrite_job.sh 1.5 KB 25 lines shellscript

1#!/usr/bin/env bash2# Pilot rewrite job helper (Gate B). Plans the stratified per-split selections of the pilot corpus and then either3# estimates, submits (live, batch) or collects. The per-split sizes are the pre-registered pilot allocation.4# Usage: scripts/pilot_rewrite_job.sh <estimate|submit|collect> [job] [corpus] [splits]5set -euo pipefail6cd "$(dirname "$0")/.."7PY=.venv/bin/python8MODE=${1:-estimate}9JOB=${2:-pilot_opus}10CORPUS=${3:-data/parsed/pilot_pmc}11SPLITS=${4:-data/splits/pilot_pmc/splits.jsonl}12size_of() { case "$1" in train) echo 700;; val) echo 90;; test) echo 150;; *) echo 30;; esac; }  # bash 3.2 compatible13for sp in train val test heldout_domain heldout_period; do14  n=$(size_of "$sp")15  case "$MODE" in16    estimate) $PY scripts/rewrite.py --corpus "$CORPUS" --job "$JOB" --n-passages "$n" --seed 1 --splits "$SPLITS" --allowed-splits "$sp" --estimate-only | grep estimate ;;17    submit)   $PY scripts/rewrite.py --corpus "$CORPUS" --job "$JOB" --n-passages "$n" --seed 1 --splits "$SPLITS" --allowed-splits "$sp" --live --batch | grep -E "estimate|submitted|BUDGET" ;;18    collect)  $PY scripts/rewrite.py --corpus "$CORPUS" --job "$JOB" --n-passages "$n" --seed 1 --splits "$SPLITS" --allowed-splits "$sp" --estimate-only > /dev/null ;;19  esac20done21if [ "$MODE" = collect ]; then22  $PY scripts/rewrite.py --corpus "$CORPUS" --job "$JOB" --n-passages 700 --seed 1 --splits "$SPLITS" --allowed-splits train --live --batch --collect | grep collect | cut -c1-20023  $PY scripts/batch_admin.py --job "$JOB" | tail -124fi25
Files main
Menu

Theme