Files
Video-Tree-TRM5/scripts/infer_video_mme.sh
T
iomgaa 8d11513e54 fix: 禁止日志缓存,确保所有日志立刻输出
- scripts/*.sh: PYTHONUNBUFFERED=1
- tools/generate_questions.py: loguru file sink enqueue=False
- main.py: loguru file sink enqueue=False

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-07-09 23:15:02 -04:00

49 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Video-MME 推理实验(TRM5 基线)
# 职责:在 900 道 Video-MME 题上跑全量推理,生成基线记录。
# 用法:
# bash scripts/infer_video_mme.sh # 全量 900 题
# N_SAMPLES=10 bash scripts/infer_video_mme.sh # smoke test
# TASK_TYPES="Action Recognition,Counting Problem" bash scripts/infer_video_mme.sh # 只跑指定题型
# SKILLS_VERSION=v2 PROMPTS_VERSION=v2 bash scripts/infer_video_mme.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
# 禁止任何形式的日志缓存,确保所有日志立刻输出
export PYTHONUNBUFFERED=1
# 加载环境变量(API key 等)
set -a
source .env
set +a
PYTHON="$(conda run -n Video-Tree-TRM which python)"
EXTRA_ARGS=()
if [[ -n "${TASK_TYPES:-}" ]]; then
IFS=',' read -ra TYPES <<< "${TASK_TYPES}"
EXTRA_ARGS+=(--task-types "${TYPES[@]}")
fi
"${PYTHON}" main.py \
--workspace-dir workspaces/default \
--store-dir store \
--mode infer \
--concurrency 24 \
--max-steps 40 \
--skill-mode auto \
--n-samples "${N_SAMPLES:-0}" \
--questions benchmarks/Video-MME \
--skills-version "${SKILLS_VERSION:-v1}" \
--prompts-version "${PROMPTS_VERSION:-v1}" \
"${EXTRA_ARGS[@]}"