Files
Video-Tree-TRM5/scripts/generate_questions.sh
T
2026-07-09 22:53:28 -04:00

35 lines
1.2 KiB
Bash
Executable File
Raw 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
# 赛题生成实验
# 职责:基于 300 棵视频树 + VLM 生成训练题目,写入 store/questions/generated/。
# 用法:
# bash scripts/generate_questions.sh # 默认参数
# PER_TYPE=5 bash scripts/generate_questions.sh # 每题型 5 道(smoke test
# CONCURRENCY=4 bash scripts/generate_questions.sh # 低并发(省 API)
# SEED=42 bash scripts/generate_questions.sh # 指定随机种子
set -euo pipefail
cd "$(dirname "$0")/.."
CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0}"
export CUDA_VISIBLE_DEVICES
# Embedding 模型已缓存本地,跳过 HuggingFace Hub 在线检查
export HF_HUB_OFFLINE=1
export TRANSFORMERS_OFFLINE=1
# 加载环境变量(API key 等)
set -a
source .env
set +a
PYTHON="$(conda run -n Video-Tree-TRM which python)"
"${PYTHON}" tools/generate_questions.py generate \
--store-dir store \
--output-dir store/questions/generated \
--per-type "${PER_TYPE:-20}" \
--similarity-threshold "${SIM_THRESHOLD:-0.85}" \
--max-retries "${MAX_RETRIES:-3}" \
--concurrency "${CONCURRENCY:-8}" \
--seed "${SEED:-2026}"