Download train/grade.sh from RightNowAI/RightNow-Mini: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/RightNowAI/RightNow-Mini/resolve/main/train/grade.sh
- Command line
-
hf download hf://RightNowAI/RightNow-Mini/train/grade.sh
-
curl -L -o grade.sh https://huggingface.co/RightNowAI/RightNow-Mini/resolve/main/train/grade.sh
1.32 kB
| # Grade every generated attempt with SWE-smith's own harness (the task's FAIL_TO_PASS and PASS_TO_PASS tests). | |
| # ATTEMPTS="1 2 ..." bash train/grade.sh | |
| # Output per attempt: /data/train/mini/results/gen/att-<k>/grade/ (the harness's logs and report) | |
| # PAR attempts are graded side by side, each with W workers. | |
| set -u | |
| R=/data/train/mini | |
| ATTEMPTS=${ATTEMPTS:-1 2 3 4 5 6 7 8}; TAG=${TAG:-gen}; W=${W:-16}; PAR=${PAR:-3} | |
| INST=${INST:-$R/src/train/pool/pool_instances.json} | |
| one() { | |
| k=$1; D=$R/results/$TAG/att-$k | |
| [ -s $D/preds.json ] || { echo "attempt $k: no preds.json"; return; } | |
| sudo -n rm -rf $D/grade # the harness skips tasks it already has logs for: never grade on top of an older run | |
| mkdir -p $D/grade && cd $D/grade | |
| echo "== grade att-$k start $(date -u +%TZ)" | |
| sudo -n env PATH=$R/venv-smith/bin:/usr/bin:/bin HF_HOME=$R/hf MINI_ASSUME_PUBLIC=1 $R/venv-smith/bin/python -m swesmith.harness.eval \ | |
| -d "$INST" -p $D/preds.json --run_id $TAG-att-$k -w $W > $D/grade/eval.log 2>&1 | |
| sudo -n chown -R "$USER":"$USER" $D/grade $R/hf 2>/dev/null | |
| echo "== grade att-$k done $(date -u +%TZ): $(tail -3 $D/grade/eval.log | tr '\n' ' ' | cut -c1-200)" | |
| } | |
| n=0 | |
| for k in $ATTEMPTS; do | |
| one "$k" & | |
| n=$((n + 1)) | |
| [ $((n % PAR)) = 0 ] && wait | |
| done | |
| wait | |