From 49b7be78aed7e9c9c35e654b302ef3a80ac277f8 Mon Sep 17 00:00:00 2001 From: iomgaa Date: Tue, 14 Jul 2026 21:12:48 -0400 Subject: [PATCH] fix: derive OUTPUT from config output_dir so CONFIG override counts correctly --- scripts/generate_ar30.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/generate_ar30.sh b/scripts/generate_ar30.sh index 72e7c11..0003f7e 100755 --- a/scripts/generate_ar30.sh +++ b/scripts/generate_ar30.sh @@ -26,7 +26,6 @@ TARGET=30 CONFIG="${CONFIG:-config/question_gen_ar30.yaml}" STORE_DIR="${STORE_DIR:-store}" DB_PATH="${DB_PATH:-logs/question_gen_ar30.db}" -OUTPUT="store/questions/generated-ar30/accepted_questions.json" MAX_ROUNDS=10 BASE_SEED=2024 EARLY_STOP_ROUNDS="${EARLY_STOP_ROUNDS:-2}" # 连续 N 轮 0 产出则提前停止 @@ -40,6 +39,12 @@ source .env PYTHON="$(conda run -n Video-Tree-TRM which python)" +# OUTPUT 从 CONFIG 的 output_dir 推导,使 CONFIG 覆盖时计数路径自动跟随;可用 OUTPUT env 覆盖 +if [ -z "${OUTPUT:-}" ]; then + OUTPUT_DIR="$("$PYTHON" -c "import yaml; print(yaml.safe_load(open('$CONFIG'))['question_gen_v2']['output_dir'])")" + OUTPUT="${OUTPUT_DIR}/accepted_questions.json" +fi + count_accepted() { if [ -f "$OUTPUT" ]; then "$PYTHON" -c "