Files
Video-Tree-TRM5/scripts/generate_questions_v2.sh

48 lines
1.6 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# v2 出题管线实验脚本
# 职责:调用 generate-v2 子命令,基于家族特化 + 四门质量检查生成新题目。
#
# 用法:
# bash scripts/generate_questions_v2.sh # 全量生成
# MODE=mock bash scripts/generate_questions_v2.sh # smoke testmock LLM/VLM
# SEED=123 bash scripts/generate_questions_v2.sh # 指定种子
# CONFIG=config/custom.yaml bash scripts/generate_questions_v2.sh # 自定义配置
#
# 环境变量:
# STORE_DIR — store 根目录(默认 store
# CONFIG — 管线配置 YAML(默认 config/default.yaml
# DB_PATH — QuestionGenStore SQLite 路径(默认 logs/question_gen.db
# SEED — 随机种子(可选,覆盖 config 中的 seed
# MODE — 设为 "mock" 启用 LLM/VLM mock 模式
#
# 日志输出:
# stderr → 终端实时显示
# logs/generate_questions.log → 完整日志
# logs/generate_v2_telemetry.db → LLM/VLM 调用遥测
# logs/question_gen.db → 出题管线运行日志
set -euo pipefail
cd "$(dirname "$0")/.."
STORE_DIR="${STORE_DIR:-store}"
CONFIG="${CONFIG:-config/question_gen_360.yaml}"
DB_PATH="${DB_PATH:-logs/question_gen.db}"
export PYTHONUNBUFFERED=1
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1
# shellcheck source=../.env
source .env
[ "${MODE:-}" = "mock" ] && export LLM_MOCK=1 VLM_MOCK=1
PYTHON="$(conda run -n Video-Tree-TRM which python)"
"${PYTHON}" tools/generate_questions.py generate-v2 \
--store-dir "$STORE_DIR" \
--config "$CONFIG" \
--db-path "$DB_PATH" \
${SEED:+--seed "$SEED"}