fix: derive OUTPUT from config output_dir so CONFIG override counts correctly

This commit is contained in:
2026-07-14 21:12:48 -04:00
parent d84f9bf777
commit 49b7be78ae
+6 -1
View File
@@ -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 "